New 24/7 monitoring and daily cloud backups now included in every Shield Pro plan.

Memory

How to fix WordPress memory limit exhausted errors

Allowed memory size exhausted means PHP ran out of RAM while loading WordPress. Heavy plugins, page builders, and imports are common triggers. This tutorial shows how to raise limits safely and find the code that eats memory.

Time: 15-25 minutes Level: Beginner

What this problem looks like

WordPress defaults to 40M unless raised. Page builders, WooCommerce imports, backup plugins, and poorly coded extensions can exceed that quickly on shared UK hosting.

Raising memory is a short-term fix. The real goal is finding which request exhausts RAM so you can update, configure, or remove the offending plugin.

Step 1: Set WordPress memory limits in wp-config.php

Add these constants above the stop editing line. WP_MAX_MEMORY_LIMIT applies in wp-admin where more RAM is needed.

php
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
If wp-config.php already defines WP_MEMORY_LIMIT, change the existing line instead of adding a duplicate constant.

Step 2: Raise PHP memory_limit in hosting

WordPress cannot exceed the server PHP memory_limit. In cPanel go to MultiPHP INI Editor and set memory_limit to 256M. On nginx hosts, ask support or edit the pool configuration.

Step 3: Read the error for the plugin name

Memory errors often include the file path. Look for wp-content/plugins/plugin-name/ in debug.log or the on-screen fatal. That names the extension to investigate first.

  • Enable WP_DEBUG_LOG if you only see a white screen.
  • Note whether the error happens on front end, admin, or cron.
  • Check if it started after importing products or running a backup.

Step 4: Isolate plugins and reduce batch jobs

Rename wp-content/plugins to plugins.disabled. If memory errors stop, re-enable plugins one at a time. For imports, reduce batch size in WooCommerce or migration tools.

Step 5: Consider hosting upgrade for heavy sites

Shops with large catalogs and page builders may need more than shared hosting RAM. A VPS or managed WordPress plan with 512M or 1G PHP memory prevents recurring exhaustion on busy admin screens.

When to stop DIY and hire help

If memory errors return after raising limits to 512M, a plugin is likely leaking RAM or your host cap is too low for your stack. BugShield diagnoses memory issues at a confirmed fixed price.

FAQs

What is a safe WP_MEMORY_LIMIT for WooCommerce?

256M is a common starting point for small shops. Large imports and page builders may need 512M on admin screens.

Will raising memory slow my site?

Higher limits do not slow normal requests. They only allow heavy operations to complete instead of fatalling.

Can a theme cause memory exhausted?

Yes, especially themes with heavy option panels or demo importers. Switch to a default theme via FTP to test.

Why does memory fail only in wp-admin?

Admin loads more scripts and plugin settings screens. WP_MAX_MEMORY_LIMIT applies specifically to dashboard requests.

Rather someone else fixed it?

Request a fix at a confirmed price. Named UK developer, secure Vault, direct chat.

Request a Fix