WordPress Memory Exhausted Error
WordPress Errors
PHP ran out of room mid-page and gave up.
A message reading “Fatal error: Allowed memory size of X bytes exhausted”, or a blank page on one specific screen — the media library, a builder, an import, or a plugin settings page.
What it actually means
Every PHP request gets a memory allowance. Exceed it and the script is killed immediately, wherever it happens to be. The limit exists to stop one runaway page taking the whole server down with it.
Raising the limit is the obvious move and often the right one, because defaults are frequently set lower than a modern site needs. But a page that needs a great deal of memory is usually doing something inefficient, and the limit is reporting a symptom rather than causing the problem.
What usually causes it
Most likely first.
- 1
The limit is simply too low
Plenty of hosts still default to 64M or less. Modern WordPress with a builder and a dozen plugins needs more.
- 2
A plugin loading too much at once
Fetching every post, order, or image into memory instead of processing in batches. Import and reporting tools are frequent offenders.
- 3
Large image processing
Resizing a very large upload can exceed the limit on its own, which is why the media library is such a common trigger.
- 4
A plugin conflict or loop
Two plugins calling each other repeatedly consume memory until the ceiling is hit.
- 5
A bloated options table
Autoloaded options are read into memory on every request. Years of plugin leftovers make every page heavier.
How to fix it
Work through these in order. Take a backup before you change anything.
Step 1 — Read the error for the number
It names the current limit, which tells you whether you are near a sensible value or still on a very low default.
Step 2 — Raise the limit to 256M
Add WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT to wp-config.php. If the host caps PHP lower, it must also be raised there or in php.ini.
Step 3 — Find which page triggers it
If it is one screen, the plugin behind that screen is your suspect. Disable it and confirm the error goes with it.
Step 4 — Check autoloaded options
Query the options table for autoloaded rows and their total size. Anything beyond a megabyte or so is worth cleaning up, carefully.
Step 5 — Move heavy jobs off the page load
Imports, exports, and bulk regeneration should run in batches or on a queue rather than inside a single request.
When to stop and call someone
Call someone if raising the limit does not help, if the error returns at steadily higher limits — a sign of a genuine leak rather than a low ceiling — or if it strikes checkout or another revenue path where every failure is a lost order.
Frequently asked
It means a PHP script tried to use more memory than its configured limit and was terminated on the spot. The limit protects the server from a single runaway request, so the message names a ceiling that was hit rather than a bug in itself.
Add WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT to wp-config.php, set to 256M. If the host enforces a lower PHP limit, that has to be raised too, in php.ini or through the hosting control panel, or the WordPress setting has no effect.
A simple site runs comfortably in 128M. A site with a page builder, WooCommerce, and a normal set of plugins is happier at 256M. Needing far more than that usually indicates an inefficient plugin rather than a genuine requirement.
Because that page is doing the expensive work — resizing a large image, loading every order, or building a complex layout. A memory error confined to one screen points straight at whatever powers that screen.
Sometimes. If the limit was set unusually low, raising it is genuinely the answer. If the site keeps hitting each new ceiling, the memory is being wasted rather than needed, and the durable fix is finding the plugin or query responsible.
If you’d rather not
We do this work every week. These are the services that cover it.
- WordPress Speed & OptimizationA slow site loses customers before they read a word. We tune WordPress for speed, stability, and search — measured, not guessed.
- Fixing WordPress PluginsOne bad plugin can take your whole site down. We fix plugin conflicts, fatal errors, and security holes fast — and build custom plugins when the off-the-shelf ones fall short.
- Site Speed & Core Web VitalsA slow site loses the customer before they see your offer. We fix what makes pages crawl — heavy images, bloated scripts, blocked rendering — and prove it with numbers.
See exactly what’s holding your website back.
Get a free audit of your site — speed, SEO, mobile, and security — with the fixes that matter most, delivered as a PDF to your inbox.