The WordPress message “Allowed memory size exhausted” means a PHP process reached the amount of memory it was allowed to use. You may see it while loading the WordPress dashboard, editing a post, uploading media, running WooCommerce tasks, or visiting a particular page.
Increasing the memory limit can sometimes solve the immediate problem, but it should not be the first assumption. A plugin, theme, import, image operation, or other task may simply be using more memory than expected. The safest fix is to find the operation consuming the memory and then decide whether the limit, the code, or the hosting environment needs attention.
What Does “Allowed Memory Size Exhausted” Mean?
PHP gives each request a memory limit. When a WordPress request attempts to use more than that limit, PHP stops the request and records an error similar to:
Allowed memory size of 268435456 bytes exhausted
The number represents the configured memory limit in bytes. For example, 268435456 bytes is 256 MB.
WordPress also has separate memory settings for front-end and administration requests. The WP_MEMORY_LIMIT setting controls the amount WordPress requests for normal rendering, while WP_MAX_MEMORY_LIMIT is used for administration tasks and can be higher. citeturn0search12turn0search13
Common Causes of WordPress Memory Errors
- A plugin performs an expensive operation or has a memory-intensive feature.
- A theme or custom code loads too much data into memory.
- A large import, export, backup, image operation, or WooCommerce task needs more memory.
- The PHP memory limit is too low for the site’s workload.
- A recent plugin, theme, PHP, or WordPress change introduced a compatibility problem.
- The hosting plan imposes a limit that WordPress cannot raise by itself.
The error message tells you that the limit was reached, not necessarily why the request needed that much memory. That distinction matters when troubleshooting.
1. Identify When the Error Happens
Start by noting the exact action that triggers the error.
- Does the homepage fail?
- Does only
/wp-admin/fail? - Does it happen when editing a particular post?
- Does a media upload trigger it?
- Does it happen during a WooCommerce operation?
- Did it begin immediately after a plugin, theme, PHP, or WordPress update?
A problem limited to one operation often points toward the component or process responsible for that operation rather than WordPress as a whole.
2. Check the PHP Memory Limit
Before changing anything, find out what PHP and WordPress are actually allowed to use. Depending on your hosting setup, you can check this through the hosting control panel, PHP information, WordPress Site Health, or your server configuration.
Do not assume that a value you add to wp-config.php is automatically the effective PHP limit. The hosting environment may impose a lower ceiling.
3. Check the Error Log
The PHP error log can reveal the file and function involved in the memory exhaustion. Look for the error at the same time you reproduced the problem.
A useful log entry may identify a plugin, theme file, WordPress component, or custom code path. That evidence is more valuable than repeatedly increasing the memory limit without knowing what is consuming it.
If you temporarily enable WordPress debugging on a production site, prefer logging errors rather than displaying them to visitors. Once troubleshooting is complete, turn temporary debugging settings back off as appropriate.
4. Test Recently Changed Plugins
If the problem started after a plugin update or installation, test that plugin first.
If you can access the dashboard, deactivate the suspected plugin and reproduce the same action. If the dashboard is unavailable, your hosting file manager or SFTP/FTP can be used to temporarily disable plugins for diagnostic purposes.
Do not delete the plugin while troubleshooting. Deactivation or temporary renaming gives you a safer path back if it turns out not to be the cause.
5. Test the Active Theme
If plugins are not responsible, test the active theme and any custom theme code. A theme can cause memory problems through inefficient queries, large data structures, image processing, or custom functionality.
Where practical, test with a current default WordPress theme. If the memory error disappears, compare the theme’s recent changes and customizations rather than assuming that the entire theme must be replaced.
6. Consider Large or Resource-Heavy Operations
Some tasks naturally require more memory than loading a normal page. Examples include:
- large CSV or XML imports;
- bulk product operations;
- image resizing or regeneration;
- large media processing jobs;
- backups and migrations;
- complex WooCommerce reports or exports;
- search indexing and other batch operations.
If the error happens only during one of these operations, increasing memory may be reasonable after confirming that the task is legitimate and the hosting environment can support it. For very large jobs, splitting the work into smaller batches can be a better solution.
7. Increase WordPress Memory Carefully
If the workload genuinely requires more memory and your host permits it, you can increase the memory WordPress requests in wp-config.php.
For example:
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
The appropriate values depend on the site and server. WordPress documentation notes that the default requested values are 40 MB for a single-site front end and 64 MB for multisite, while the administration limit has a separate setting and is commonly higher. citeturn0search12
Place these definitions before the line in wp-config.php that says:
/* That's all, stop editing! Happy publishing. */
Increasing the WordPress setting does not guarantee that PHP will actually allow that amount. Some hosts do not permit WordPress to increase the PHP memory limit automatically, in which case the host must change the server configuration. citeturn0search13
8. Do Not Keep Increasing the Limit Indefinitely
If 128 MB becomes 256 MB, and then 512 MB still produces the same error, stop treating the limit as the main problem.
A plugin or custom process may have an inefficient operation, an unexpectedly large query result, or a compatibility problem. More memory can hide the symptom temporarily while allowing the underlying problem to grow.
Use logs and controlled plugin/theme tests to determine what changed and why the request needs so much memory.
9. Check Your Hosting Restrictions
Managed WordPress, shared hosting, VPS, and dedicated servers can have very different PHP configurations. Your host may control memory_limit, PHP-FPM settings, process limits, or other server resources.
If WordPress reports a higher requested value but PHP still stops at a lower limit, contact the hosting provider. Give them the exact memory error and timestamp and ask them to confirm the effective PHP memory limit and any relevant account resource restrictions.
10. What If You Cannot Access WordPress Admin?
You can still diagnose many memory errors without the dashboard.
- Check the hosting/server error log.
- Temporarily disable recently changed plugins using the file manager or SFTP/FTP.
- Ask the host to confirm the PHP memory limit.
- Review recent theme or custom-code changes.
- Restore from a known-good backup only when necessary and when you understand what data would be replaced.
Make one change at a time and test after each change. This makes it much easier to identify the component that caused the failure.
Common Mistakes to Avoid
- Changing memory limits without checking logs: you may miss the real cause.
- Editing server configuration without a backup: configuration mistakes can make recovery harder.
- Deleting a suspected plugin immediately: disable it first so you can restore the site cleanly.
- Using an extremely high memory limit as a permanent fix: the server still has finite resources.
- Displaying PHP errors publicly: use logging for production troubleshooting whenever possible.
Quick Troubleshooting Checklist
- Record exactly when and where the error occurs.
- Check the effective PHP memory limit.
- Read the PHP/server error log.
- Identify recent plugin, theme, PHP, or WordPress changes.
- Test suspected plugins individually.
- Test the active theme if necessary.
- Consider whether a large operation is legitimately consuming more memory.
- Increase WordPress memory only when appropriate and supported by the host.
- If the problem persists, investigate the code or operation rather than continually increasing memory.
- Contact the hosting provider when server-level limits or failures are involved.
Final Thoughts
The “Allowed memory size exhausted” error is a useful clue: a PHP request reached its memory ceiling. The best fix is not always a bigger ceiling.
Start with the error log, identify the action that triggers the problem, and isolate recent changes. If the site’s workload genuinely needs more memory, raise the limit within the resources available on the server. If a particular plugin, theme, or process is responsible for unusually high usage, fix that cause instead.
Last reviewed: September 16, 2026.

Leave a Reply to This Post