"Allowed memory size of ... bytes exhausted" means a page needed more memory than PHP is allowed to use, so WordPress stopped, often showing a white screen or a critical error. Raise the limit by adding define( 'WP_MEMORY_LIMIT', '256M' ); to wp-config.php. On shared hosting, the host's own limit may be lower, and only they can raise it. If memory keeps running out, find the plugin using it instead of raising the limit forever.
What's the problem
You see "Allowed memory size of xxxxxx bytes exhausted" (with a number in place of the x's), a white screen, or a critical error, often on heavy pages such as the editor, imports, or WooCommerce reports.
Why it happens
- The default limit is too low for your plugins and content.
- A heavy plugin: page builders, backup, security scanning and import tools use a lot of memory.
- A plugin bug using memory in a loop.
- Large imports or image processing.
- Your host's PHP limit is lower than what WordPress asks for, so WordPress can't go above it.
How to fix it
- Open
wp-config.phpand adddefine( 'WP_MEMORY_LIMIT', '256M' );above the line that says "That's all, stop editing!". - Reload the page. If the error is gone, the limit was the problem.
- If nothing changes, your host's PHP limit is lower. Ask them to raise it, or change
memory_limitin your hosting panel's PHP settings if it has one. - If it keeps happening, find the heavy plugin: disable plugins one at a time and watch whether the error stops.
- Use debug logging (
WP_DEBUG_LOG) to see which file was running when memory ran out.
What Preventionlabs checks
One click runs the full report on your domain. For this problem it shows your WordPress version and plugins against the latest releases; whether your site loads, how fast, and where its redirects go; up to 50 pages from your sitemap, listing any that fail or are slow, plus broken links on them; files that should never be public, such as .env and .git. With Cloudflare connected, it also shows which pages returned server errors (5xx) to visitors, and when. It can't log in to WordPress, so the exact error is in your host's error log or WordPress debug log.
Run your free reportYour first report is free, no card needed. Then A$50 a month, up to 10 domains. Read-only: it never changes anything.
Sources
- WordPress: Editing wp-config.phpofficial docs
WP_MEMORY_LIMIT option allows you to specify the maximum amount of memory that can be consumed by PHP. This setting may be necessary in the event you receive a message such as “Allowed memory size of xxxxxx bytes exhausted”.
- WordPress: Common WordPress errorsofficial docs
If you are on shared hosting you may have to ask your hosting provider to increase your memory limit for you.
- WordPress: Common WordPress errorsofficial docs
Increase your memory limit in wp-config.php .
Preventionlabs is independent and not affiliated with WordPress. Product names are used only to describe the problem.
← All of WordPress