Diagnostic tool

WordPress Memory Limit Exhausted Fix Tool

By GrowrAI Editorial Team Browser only, no data sent

The fatal PHP error 'Allowed memory size of X bytes exhausted' is one of the most misdiagnosed WordPress problems. Increasing WP_MEMORY_LIMIT in wp-config.php often does nothing because the real cap lives in php.ini, .user.ini, the FastCGI pool, or your host's control panel. This advanced tool asks four targeted questions and returns the exact override path for your host plus a memory-leak detection routine, not generic copy-paste advice.

Stop 'Allowed memory size exhausted' fatal errors with host-specific overrides and real leak detection.

No login required Free forever

What this tool does

The WordPress Memory Limit Exhausted Fix Tool is an advanced, host-aware diagnostic designed for the single most misdiagnosed fatal PHP error on WordPress: 'Allowed memory size of X bytes exhausted'. Almost every generic guide tells you to add define('WP_MEMORY_LIMIT', '256M'); to wp-config.php and call it done. On modern managed and shared hosts this constant is silently ignored because the real ceiling lives in the host's PHP-FPM pool, hPanel, Site Tools, or a plan-level enforcement layer.

The 'Allowed memory size exhausted' error is the highest-volume WordPress fatal error after the white screen of death, and the one with the lowest first-fix success rate. Site owners burn hours editing wp-config.php on hosts that override it, or pay for a hosting upgrade they did not need because they never identified the real leak. WooCommerce stores lose checkout completions every minute the error fires, and Google Search Console flags the URLs as 5xx within a single crawl cycle, which can suppress rankings for days even after the fix.

Runs in your browser
No files uploaded, no credentials requested.
Maintained by people
Reviewed and kept current by the GrowrAI editorial team.
Tested on live sites
Every fix path verified on a real broken WordPress install.

Scroll down for the full walkthrough, common mistakes, and FAQs. If you already know what you need, use the form below to get an instant recommendation.

Step 1: Describe the issue

Frequently asked questions

Why does raising WP_MEMORY_LIMIT in wp-config.php do nothing on my host?

Because the real ceiling is enforced by PHP-FPM or the hosting control panel, not by WordPress. SiteGround, Kinsta, WP Engine, and Hostinger all override the WordPress constant. You must raise memory_limit in the host's PHP settings UI, php.ini, or the FPM pool, not in wp-config.

What is a safe memory_limit value for WordPress?

256M is the minimum for a modern site, 512M is the safe default for WooCommerce, page builders, and membership plugins, and 768M handles heavy admin sessions with the block editor. Going above 1024M on shared hosting risks throttling or suspension.

How do I confirm the new memory_limit actually applied?

Drop a temporary file named phpinfo.php with <?php phpinfo(); in your site root, visit it, and read the memory_limit row. Delete the file immediately after, it exposes server details. Do not rely on the Site Health screen, it reports WP_MEMORY_LIMIT, not the PHP-FPM enforced value.

Is the memory error always a plugin problem?

No. Roughly 60 percent of cases are a host cap that the wp-config edit cannot override. The other 40 percent are a leaking plugin, usually related-posts, analytics, SEO, or a misbehaving page builder add-on. The MU memory logger in the tool tells you which category you are in within 30 minutes of real traffic.

Why does the error happen only when I upload images?

Image decoding allocates roughly 5x the pixel count in RAM. A single 4000x3000 photo needs about 240MB before any plugin overhead. Either raise memory_limit to 512M or set a big_image_size_threshold filter so WordPress downscales uploads on intake.

Why does the error happen only in wp-admin?

wp-admin loads every plugin's admin hooks plus the block editor's REST stack. Admin requests typically need 2 to 3 times the memory of front-end requests. Set WP_MAX_MEMORY_LIMIT to 768M and drop a .user.ini with memory_limit = 768M inside /wp-admin.

Can I detect which plugin is leaking memory?

Yes. Install Query Monitor and sort the requests panel by Peak Memory, or drop the MU logger snippet from the tool into /wp-content/mu-plugins/memory-log.php. Reproduce normal traffic for 15 to 30 minutes, then read /wp-content/debug.log for the top URLs by peak memory.

What does WP_MAX_MEMORY_LIMIT do that WP_MEMORY_LIMIT does not?

WP_MEMORY_LIMIT applies to front-end and most code paths. WP_MAX_MEMORY_LIMIT applies specifically to admin and image-processing tasks and overrides the lower constant in those contexts. Set both, with the max value equal to or higher than the base.

In-depth guide

Everything you need to know about the WordPress Memory Limit Exhausted Fix Tool

Overview

The WordPress Memory Limit Exhausted Fix Tool is an advanced, host-aware diagnostic designed for the single most misdiagnosed fatal PHP error on WordPress: 'Allowed memory size of X bytes exhausted'. Almost every generic guide tells you to add define('WP_MEMORY_LIMIT', '256M'); to wp-config.php and call it done. On modern managed and shared hosts this constant is silently ignored because the real ceiling lives in the host's PHP-FPM pool, hPanel, Site Tools, or a plan-level enforcement layer.

This tool asks four targeted questions, where the site is hosted, when the error happens, whether you have already tried the wp-config edit, and your access level, then returns the exact override path for SiteGround, Bluehost, Hostinger, Kinsta, WP Engine, Cloudways, generic cPanel, and Local. It also bundles a copy-paste MU plugin that logs peak memory per URL, so you can prove which plugin is leaking instead of guessing.

Why this matters for WordPress site owners

The 'Allowed memory size exhausted' error is the highest-volume WordPress fatal error after the white screen of death, and the one with the lowest first-fix success rate. Site owners burn hours editing wp-config.php on hosts that override it, or pay for a hosting upgrade they did not need because they never identified the real leak. WooCommerce stores lose checkout completions every minute the error fires, and Google Search Console flags the URLs as 5xx within a single crawl cycle, which can suppress rankings for days even after the fix.

How to use this tool, step by step

  1. 1Pick your host from the list, the override path is fundamentally different on each one.
  2. 2Choose when the error appears, on every page, only in wp-admin, during uploads, during cron jobs, or randomly.
  3. 3Tell the tool whether you have already raised WP_MEMORY_LIMIT and what happened.
  4. 4Select your access level, the tool prefers SSH/CLI paths when available because they bypass FastCGI caches.
  5. 5Run the host-specific override, then verify with a temporary phpinfo() probe, never trust the WordPress Site Health screen alone, it reads WP_MEMORY_LIMIT, not the real PHP cap.

Expertise and methodology

The override paths are maintained against the current Site Tools (SiteGround), hPanel (Hostinger), MyKinsta, WP Engine User Portal, Cloudways Platform, and standard cPanel + MultiPHP INI Editor flows. The leak-detection MU plugin uses memory_get_peak_usage(true), which reports real allocated memory rather than reported usage, and is the same instrumentation Query Monitor exposes in its Peak Memory column. Every host-specific note reflects how the underlying PHP handler (suPHP, PHP-FPM, LiteSpeed LSAPI) reads or ignores user-supplied ini files, which is the root reason wp-config edits fail in the first place.

GrowrAI editorial team avatar
Reviewed and maintained by GrowrAI Editorial Team. Every fix path is tested on a live WordPress install before it is published here.

Common mistakes to avoid

  • Editing wp-config.php and stopping there. On SiteGround, Kinsta, WP Engine, and Hostinger the host cap wins, the WordPress constant is purely advisory.
  • Setting memory_limit to 2G or higher on shared hosting. The host will throttle or suspend the account before WordPress ever crashes, and you will be told the site was abusive rather than leaking.
  • Increasing the limit instead of finding the leak. A plugin that allocates 400MB per request is broken, raising the ceiling to 1GB only delays the next crash.
  • Leaving the MU memory logger in place on production. It writes to error_log on every request and will fill the log volume within days.
  • Trusting the WordPress Site Health 'PHP memory limit' check, it reflects what WordPress thinks, not what PHP-FPM enforces.

Reading the fatal error properly

The message 'Allowed memory size of X bytes exhausted' is precise and worth reading closely rather than skimming. The first number is the current limit, which tells you what the site is actually running with as opposed to what you think you configured. The second number is how much more memory was being requested at the moment it failed, and a small figure such as a few hundred kilobytes means you were just over the line, while a large one means something is trying to load an enormous amount at once. The file path and line number at the end name the code that was executing, and in most cases that is the plugin or theme responsible.

That distinction matters because it changes the fix. Being marginally over a low limit is a configuration problem and raising the limit is a legitimate answer. Requesting an enormous block in one go is a code problem, usually an import, an unbounded query or an image operation on a very large file, and raising the limit only delays the failure until the next slightly larger job.

Where the limit is set, and which setting wins

There are several layers and they override each other in a specific order, which is why edits often appear to do nothing. PHP has its own memory_limit, set by the host in php.ini or through the control panel. WordPress then applies WP_MEMORY_LIMIT for front-end requests and WP_MAX_MEMORY_LIMIT for admin requests, both defined in wp-config.php. WordPress cannot exceed the PHP limit, so setting WP_MEMORY_LIMIT to 512M while PHP is capped at 128M achieves nothing at all.

Check what is actually in effect rather than assuming. Tools, Site Health, Info in the WordPress dashboard reports the PHP memory limit as the server sees it, which is the number that matters. Raise the PHP limit first through the hosting panel, then set the WordPress constants at or below it. On managed hosts the PHP limit is often fixed and only the host can change it, in which case a support ticket is faster than any file edit.

Finding what is consuming the memory

Once the site is stable again, find the cause instead of leaving a raised limit as the permanent answer. Query Monitor reports peak memory usage per page and highlights which plugin's queries and hooks are responsible, which usually identifies the offender within a few page loads. Compare a lightweight page against the one that fails; a large gap between them points at something loading on that specific template rather than a sitewide problem.

Some causes are predictable. Image processing on very large uploads can exceed the limit during thumbnail generation, and resizing before upload solves it permanently. Imports and migrations load large batches into memory, so running them in smaller chunks or through WP-CLI avoids the web request limit entirely. Backup plugins working on a large uploads folder are another frequent source, and scheduling them outside peak hours with a lower batch size is more sustainable than doubling the memory. If a single plugin repeatedly exhausts memory on an otherwise ordinary page, that is a bug worth reporting, and often worth replacing.

Need hands-on help?

If this tool does not cover your exact situation, contact GrowrAI or read the troubleshooting guides. We typically reply within one business day.