
“Fatal error: Allowed memory size of 134217728 bytes exhausted” โ this message means a PHP process running your WordPress site tried to use more memory than the server allows, so PHP killed it mid-request. The result is a broken page or a full white screen. The WordPress memory exhausted fix is usually quick: raise the PHP memory limit and, if it keeps happening, find the plugin or script eating all that memory. This 2026 guide shows you how.
What Causes the “Allowed Memory Size Exhausted” Error?
PHP enforces a per-request memory limit so one runaway script cannot consume all server RAM. WordPress’s own default is just 40MB (64MB for multisite) โ far too little for modern sites running page builders, WooCommerce, or dozens of plugins. The common triggers are:
- Too many or too heavy plugins: Each active plugin adds to every request’s memory footprint. Page builders, security suites, and SEO plugins are the usual heavyweights.
- Large media operations: Bulk image uploads, regenerating thumbnails, or importing large files can spike memory past the limit.
- WooCommerce / membership / LMS sites: Stores and course sites legitimately need more memory โ WordPress.org recommends 256MB for production, and Elementor itself asks for 512MB.
- A buggy plugin or theme: A memory leak โ code that keeps allocating memory without releasing it โ can exhaust even a generous limit.
- Server-level cap too low: Your hosting plan may cap PHP memory at 128MB or lower, and WordPress cannot raise it above that ceiling no matter what you set in wp-config.php.
- Stuck background tasks: Cron jobs or scheduled tasks running amok can drain memory repeatedly.
How to Fix the “Allowed Memory Size Exhausted” Error
Start with the quick fix, then investigate the cause so it does not return:
- Raise WP_MEMORY_LIMIT in wp-config.php. Open
wp-config.phpvia FTP or your hosting file manager and add these lines just above “That’s all, stop editing!”:define('WP_MEMORY_LIMIT', '256M');anddefine('WP_MAX_MEMORY_LIMIT', '512M');The first covers the front end, the second covers admin operations (imports, updates). Save and reload your site โ this resolves most cases immediately. - Raise the server-level memory limit. The wp-config setting cannot exceed the server’s PHP
memory_limit. In cPanel, go to MultiPHP INI Editor โ select your domain โ setmemory_limitto 256M (512M for WooCommerce or heavy sites) โ Apply. Alternatively addmemory_limit = 256Mto a.user.inifile in your site root. (Skip the .htaccessphp_valuemethod on PHP-FPM servers โ it causes a 500 error there.) More server-tuning walkthroughs are on the KamiWeb blog. - Find the memory hog. Enable the debug log (
WP_DEBUG+WP_DEBUG_LOG, display off), reproduce the crash, and checkwp-content/debug.logโ the file named in the fatal error is your prime suspect. Deactivate it and see if the error stops.

- Deactivate and audit plugins. Rename
wp-content/pluginsvia FTP to switch everything off; if the site loads, reactivate one by one to find the culprit. Then permanently remove plugins you do not need โ fewer plugins means less memory per request. Choose lean, well-maintained ones from our free WordPress plugins collection. - Optimize media handling. If the crash happens during uploads or thumbnail regeneration, process images in smaller batches, compress images before uploading, and consider a lightweight media-optimization setup rather than regenerating thousands of thumbnails at once.
- Ask your host to raise the hard cap โ or upgrade. If the server enforces a low limit you cannot change, contact support and request an increase. On tiny shared plans that refuse, upgrading to a plan with more resources (or a host with generous PHP defaults) is the honest fix โ no code change can beat a hard server ceiling.
- Keep everything updated and monitored. Outdated plugins are the most common source of memory leaks. Enable auto-updates for minor releases, check Tools โ Site Health โ Info โ Server to confirm your real memory limit, and watch for the error returning after each new plugin install. For everyday site utilities, bookmark the KamiWeb free tools.
Conclusion
“Allowed memory size exhausted” is PHP telling you the budget ran out: raise WP_MEMORY_LIMIT to 256M, match the server-level limit, then hunt down the plugin or process consuming it all. Treat the limit increase as the bandage and the audit as the cure โ your site will be faster and more stable for it. For more free WordPress resources, start at the KamiWeb homepage.
