wordpress memory exhausted error fix - featured image

WordPress Memory Exhausted Error Fix: 7 Proven Fixes

You need a WordPress memory exhausted error fix when your site suddenly shows “Allowed memory size exhausted” or a blank white screen, often right at checkout. Every minute it stays broken costs you orders and customer trust. The good news is that this error is rarely mysterious. Below you’ll find each real cause, how to confirm it and the exact fix.

Free WooCommerce store health check

Enter your store URL — we test the checkout, cart, SSL and speed in seconds. No login, nothing installed.

We only fetch public pages of the store you enter. We never touch your admin or ask for a password.

Quick answer: The simplest WordPress memory exhausted error fix is raising WP_MEMORY_LIMIT in wp-config.php to 256M. The error means a PHP process needed more memory than your server allows. If it returns, a heavy plugin, theme, bloated database or large import is the real culprit, so find and fix that instead of raising limits again.

First, read the error message properly

Before changing anything, look closely at the full message. It usually reads something like: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /wp-content/plugins/some-plugin/file.php on line 412.

Two parts of that line matter:

  • The byte number is your current limit. Divide it by 1,048,576 to get megabytes, so 134217728 is 128 MB.
  • The file path shows where PHP was when memory ran out. If it points to a plugin folder, that plugin is your first suspect. However, it can also be an innocent victim of something that used up memory earlier.

If you only see a white screen, check the error log in your hosting control panel. Alternatively, WordPress may have emailed the admin address a “technical issue” notice with the same details. Knowing where it failed is the first step of any WordPress memory exhausted error fix.

Cause 1: The PHP memory limit is too low (the classic WordPress memory exhausted error fix)

Symptom: The error appears in many places, not just one page, and the limit shown is small, such as 40 MB or 64 MB.

Why it happens: By default, WordPress asks for only 40 MB on the front end. A modern WooCommerce store with a page builder, an SEO plugin and payment gateways easily needs more. Meanwhile, your host sets its own ceiling, and WordPress can never go above it.

How to check: Go to Tools → Site Health → Info, then open the Server and WordPress Constants sections. Note the PHP memory limit and the WP_MEMORY_LIMIT value.

How to fix it:

  1. Connect with SFTP or your host’s file manager and download a copy of wp-config.php as a backup.
  2. Above the line that says “That’s all, stop editing!”, add:
    define( 'WP_MEMORY_LIMIT', '256M' );
    define( 'WP_MAX_MEMORY_LIMIT', '512M' );
  3. Save the file, reload the site and check Site Health again.
  4. If the number hasn’t changed, your host caps PHP memory. In that case, raise memory_limit in your PHP settings (for example, cPanel’s MultiPHP INI Editor) or ask support to do it.

The official WordPress guide to editing wp-config.php explains both constants in more detail. For most small stores, 256 MB is plenty. If you need far more than that, treat it as a warning sign rather than a solution.

Cause 2: A plugin with a memory leak or heavy workload

Symptom: The error started right after installing or updating a plugin, or the file path in the message points to one plugin folder.

Why it happens: Some plugins load huge amounts of data on every page. For example, they may pull every product, order or log entry into memory at once. Others contain a bug that loops until memory runs out, and no realistic limit will ever be enough.

How to check: If you can reach the dashboard, deactivate plugins one at a time and test. If you can’t, use SFTP to rename wp-content/plugins to plugins-off. If the site then loads, a plugin is to blame.

How to fix it:

  1. Rename the folder back to plugins. Then rename individual plugin folders, one by one, until the error disappears.
  2. Once you find the culprit, check for an update or a known issue in its support forum.
  3. If there’s no fix yet, roll it back to the previous version or replace it with a lighter alternative.
  4. Above all, test on a staging copy first if your store is taking live orders.

Of all the routes to a WordPress memory exhausted error fix, isolating a single plugin is the one that most often solves the problem for good.

Cause 3: Your theme or page builder is doing too much

Symptom: The editor crashes, or the error appears mainly on pages built with Elementor, Divi or a similar builder. The file path points to wp-content/themes or the builder plugin.

Why it happens: Builders load many widgets, fonts and settings on every request. Long pages with dozens of sections, nested templates and global widgets multiply that cost. Older themes that bundle their own plugins make it worse.

How to check: On a staging site, temporarily switch to a default theme such as Twenty Twenty-Five. If the error goes away, the theme is involved.

How to fix it:

  • Update the theme and builder to their latest versions.
  • Disable builder widgets and modules you don’t use. Most builders have a features or performance screen for this.
  • Split very long pages into shorter ones, and delete unused templates and saved sections.
  • Remove plugins bundled with old themes if you no longer need them.

For builder-heavy sites, this is often the WordPress memory exhausted error fix that also makes pages noticeably faster.

Cause 4: Large imports, exports, reports or images

Symptom: The site works normally, but the error appears when you import products, export orders, run a report or upload a large photo.

Why it happens: These tasks process a lot of data in one go. A 6000-pixel phone photo, for instance, must be fully decoded in memory before WordPress can create thumbnails. Similarly, exporting thousands of orders at once can exceed even a generous limit.

How to check: Note exactly which action triggers the error. If it’s always the same task, you’ve found your cause.

How to fix it:

  1. Resize images to around 2000 pixels wide before uploading them.
  2. Split big CSV imports into smaller files of a few hundred rows each.
  3. Export orders by date range instead of all at once.
  4. Make sure WP_MAX_MEMORY_LIMIT is set, because it applies to admin tasks like these.

In practice, this WordPress memory exhausted error fix is mostly about working in smaller batches.

Cause 5: A bloated database and autoloaded options

Symptom: Every page feels slow, the error appears at random, and the site has run for years with many plugins installed and removed.

Why it happens: WordPress loads all “autoloaded” options into memory on every single request. Deleted plugins often leave their settings behind, and some store large logs or caches there. Over time, this pile can reach several megabytes and quietly eat your memory budget.

How to check: Recent WordPress versions flag oversized autoloaded data under Tools → Site Health. Alternatively, run this query in phpMyAdmin, adjusting the table prefix if yours isn’t wp_:

SELECT SUM(LENGTH(option_value)) FROM wp_options WHERE autoload IN ('yes','on','auto-on','auto');

As a rough guide, under 1 MB is healthy, while several megabytes is a problem.

How to fix it:

  1. Take a full database backup first.
  2. Sort options by size and identify large entries left by plugins you no longer use.
  3. Delete those orphaned rows, or set their autoload value to off if you’re unsure.
  4. Clear expired transients with a trusted cleanup plugin.

Cleaning autoload data is a WordPress memory exhausted error fix that also speeds up every page. If a cleanup ever goes wrong, our guide on restoring a WordPress site from backup walks you back to a working state.

Cause 6: An outdated or mismatched PHP version

Symptom: The error appeared after your host changed PHP versions, or you’re still running PHP 7.x.

Why it happens: Newer PHP versions handle memory far more efficiently than old ones. On the other hand, an outdated plugin on a new PHP version can throw endless warnings, and that churn uses memory too.

How to check: Look at Tools → Site Health → Info → Server for the PHP version. Then check your error log for deprecation warnings piling up from the same plugin.

How to fix it: Move to a currently supported PHP version after testing on staging. Our step-by-step guide on how to update the PHP version in WordPress covers this safely. Afterwards, update or replace any plugin that floods the log.

Cause 7: A stuck cron job or Action Scheduler backlog

Symptom: The error shows up at odd hours, often when no visitor is doing anything special. The log mentions wp-cron.php or Action Scheduler.

Why it happens: WooCommerce and many plugins queue background tasks. If thousands pile up, or one task keeps failing and retrying, a single cron run may try to process far too much at once.

How to check: Go to WooCommerce → Status → Scheduled Actions and look at the Pending and Failed counts.

How to fix it:

  • Find the hook with the most failed or pending actions. It usually points to one plugin.
  • Fix or update that plugin, then clear out old failed actions.
  • Consider replacing WP-Cron with a real server cron job so tasks run in small, regular batches.

Once the queue is healthy, this WordPress memory exhausted error fix usually stops those random overnight crashes.

Troubleshooting table: symptom, likely cause, quick fix

Use this table to choose the right WordPress memory exhausted error fix for what you’re seeing.

What you seeLikely causeQuick fix
Error everywhere, limit shows 40–64 MBLow PHP memory limitSet WP_MEMORY_LIMIT to 256M; ask host to raise the cap
Started right after a plugin updatePlugin bug or memory leakRoll back or disable that plugin
Builder editor won’t loadTheme or page builder overloadUpdate, disable unused modules, shorten pages
Only during imports, exports or uploadsLarge batch or huge imageSmaller batches, resize images first
Slow everywhere, random crashesBloated autoloaded optionsBack up, then clean orphaned options
Began after a PHP changePHP version mismatchUpdate PHP and incompatible plugins
Errors at odd hours, cron in the logAction Scheduler backlogClear failed actions, use a real cron

How to stop the error coming back

Once your site is stable, a few simple habits will keep it that way:

Ultimately, the best WordPress memory exhausted error fix removes the cause instead of hiding it behind a bigger number.

When to call in a pro

Sometimes the cause isn’t obvious. The error moves between pages, raising the limit doesn’t help, or you simply can’t risk breaking a store that’s taking orders. In those cases, a professional WordPress memory exhausted error fix saves you hours of guesswork.

Our WordPress bug fix service is built for exactly this situation. Here’s what you get:

  • Same-day start on your issue.
  • The real cause found and fixed, not just a higher memory limit.
  • A backup taken first, before anything is changed.
  • The fix tested on a staging copy before it touches your live store.
  • You never send a password by email.
  • Fixed or refunded.
  • Pricing from $75.

So if you’d rather get back to running your business, let us handle the debugging.

Not sure which fix you need? Send us your store.

Leave your name and what is happening on WhatsApp — we diagnose it, talk it through and send you a quote. No obligation, no jargon.

Message us on WhatsApp

Frequently asked questions

What does “Allowed memory size exhausted” mean in WordPress?

It means a single PHP process tried to use more memory than your server permits. PHP stops the request immediately, which is why you see a fatal error or a blank page. Nothing is permanently damaged, but the page can’t load until the cause is fixed.

How much memory should a WooCommerce store have?

For most small and medium stores, 256 MB is a sensible WP_MEMORY_LIMIT. If a normal page needs more than 512 MB to load, something is wrong. That’s your cue to find the heavy plugin or process.

Is it safe to increase the PHP memory limit?

Yes, within reason. It’s a standard setting and won’t harm your site. However, setting it very high can hide a leaking plugin and let one bad request slow down your whole server.

Why does the error come back after I increase the limit?

Usually because something keeps consuming memory until it hits whatever limit you set. A looping plugin, a huge autoloaded option or a cron backlog will eventually use it all. The lasting WordPress memory exhausted error fix is to find and remove that cause.

Can my hosting plan cause this error?

Yes. Some budget plans cap PHP memory at 64 or 128 MB, and WordPress can’t go above that. If your host won’t raise it, upgrading the plan or moving to a better host may be necessary.

Similar Posts