WordPress Memory Exhausted Error

WordPress Errors

PHP ran out of room mid-page and gave up.

datacram.com/fix/wordpress-memory-exhausted-error
Likely causes, ranked
WordPress Memory Exhausted Error
The limit is simply too lowmost likely
A plugin loading too much at oncecommon
Large image processingcommon
A plugin conflict or looppossible
Fix steps in this guide5
the causes explained below, most likely first
What you’re seeing

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. 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. 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. 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. 4

    A plugin conflict or loop

    Two plugins calling each other repeatedly consume memory until the ceiling is hit.

  5. 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.

  1. Step 1Read 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.

  2. Step 2Raise 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.

  3. Step 3Find 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.

  4. Step 4Check autoloaded options

    Query the options table for autoloaded rows and their total size. Anything beyond a megabyte or so is worth cleaning up, carefully.

  5. Step 5Move 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.

Free · AI-powered · Emailed to you

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.

Get my free audit
CallGet a quote