When WordPress runs out of memory inside wp-admin, the dashboard may freeze, return a fatal error, or fail while a plugin is active. This guide focuses on restoring administrator access and finding the process using excess PHP memory.
You may see a message similar to:
Fatal error: Allowed memory size of 134217728 bytes exhausted
This means WordPress or one of its plugins attempted to use more PHP memory than the server currently allows.
Increasing the memory limit can solve the immediate problem, but a site that repeatedly runs out of memory may also have a heavy plugin, inefficient theme, large import process, or hosting resource limitation.
QUICK ANSWER
If WordPress shows an “Allowed memory size exhausted” error, first identify the affected plugin or process. Then increase the WordPress/PHP memory limit if your host allows it, deactivate unusually heavy plugins, update WordPress and PHP, check your theme, clear caches, and review your hosting resource limits. Increasing memory alone should not replace finding the underlying cause.
What Does “Allowed Memory Size Exhausted” Mean?
WordPress runs on PHP.
PHP is given a maximum amount of memory that each request can use. When WordPress needs more memory than that limit, PHP stops the process and displays a fatal error.
The error usually contains two numbers:
Allowed memory size of 134217728 bytes exhausted
(tried to allocate 20480 bytes)
The first number represents the current memory limit in bytes.
For example:
- 67,108,864 bytes is approximately 64 MB.
- 134,217,728 bytes is approximately 128 MB.
- 268,435,456 bytes is approximately 256 MB.
- 536,870,912 bytes is approximately 512 MB.
The second number indicates how much additional memory PHP attempted to allocate when the error occurred.
The problem can appear while:
- opening wp-admin,
- editing a post or page,
- installing or updating a plugin,
- importing content,
- processing large images,
- running WooCommerce operations,
- building pages with a page builder,
- or loading the public website.
1. Check Your Current WordPress and PHP Memory Limits
Before changing anything, check how much memory your site currently has available.
In WordPress, go to:
Tools → Site Health → Info → Server
Look for information such as:
- PHP memory limit,
- PHP version,
- server architecture,
- and maximum input variables.
You can also check your hosting control panel for PHP settings.
Knowing the existing limit helps you avoid randomly increasing it without understanding the current configuration.
If your PHP memory limit is already very high and the site still exhausts it, the underlying problem is more likely to be a plugin, theme, database process, or runaway PHP task.
2. Increase the WordPress Memory Limit in wp-config.php
If your hosting plan allows more PHP memory, you can ask WordPress to use a higher amount.
Before editing wp-config.php, make a backup.
Open the WordPress root directory using your hosting file manager or FTP/SFTP.
Find:
wp-config.php
Add this line before:
/* That's all, stop editing! Happy publishing. */
For example:
define( 'WP_MEMORY_LIMIT', '256M' );
For administrative tasks that require additional memory, WordPress also supports a separate maximum value:
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
Do not automatically set extremely high values.
If your server only allows 128 MB, setting WordPress to 512 MB will not necessarily override the server-level restriction.
Your hosting provider ultimately controls the maximum amount of PHP memory available to the site.
3. Increase the PHP memory_limit at the Hosting Level
If changing wp-config.php does not increase the available memory, the server-level PHP setting may be lower.
Depending on your host, look for a menu such as:
- PHP Configuration,
- PHP Options,
- PHP Settings,
- MultiPHP INI Editor,
- or Server Configuration.
Find:
memory_limit
A common configuration might be:
memory_limit = 256M
Some hosts allow this value to be changed directly.
Others restrict it according to your hosting plan.
If you cannot change the setting, contact your hosting provider and ask:
- what your current PHP memory limit is,
- whether it can be increased,
- and whether your account is reaching other resource limits.
CPU, process, database, or account-level limits can sometimes cause symptoms that look similar to insufficient PHP memory.
4. Disable Heavy or Problematic Plugins
A plugin can consume excessive memory because of a bug, large query, background process, compatibility issue, or unusually heavy workload.
If the error started immediately after installing or updating a plugin, that plugin should be one of the first things you test.
From the WordPress dashboard, go to:
Plugins → Installed Plugins
Temporarily deactivate the suspected plugin and reload the affected page.
If you do not know which plugin is responsible, deactivate plugins in small groups or temporarily deactivate all plugins.
If You Cannot Access wp-admin
Open your hosting file manager or FTP/SFTP and go to:
/wp-content/
Rename:
plugins
to:
plugins-disabled
Then reload your site.
If the error disappears, restore the folder name to plugins and test individual plugins until you find the problem.
If WordPress becomes completely inaccessible after a plugin problem, our WordPress Critical Error guide may also help.
5. Test Your WordPress Theme
The active theme can also consume excessive memory.
This is especially possible with:
- large multipurpose themes,
- custom PHP functions,
- page builders,
- theme-based analytics or tracking features,
- large dynamic queries,
- or outdated theme code.
Temporarily switch to a standard lightweight WordPress theme and test the site again.
If the memory error disappears, the issue may be related to the previous theme or one of its bundled components.
Before permanently changing themes, check whether an update is available and review any custom code added to:
functions.php
Also review any custom snippets or child-theme modifications.
6. Update WordPress, Plugins, Themes, and PHP
Old software can create compatibility problems and inefficient PHP processes.
Check:
- WordPress core,
- plugins,
- themes,
- and your PHP version.
Before major updates, create a backup.
Do not change PHP versions blindly on a production website.
First confirm that your important plugins and theme support the target PHP version.
If the memory error appeared immediately after an update, the opposite may also be true: a new plugin or theme version may have introduced a conflict.
In that case, review the most recent change before modifying unrelated settings.
7. Check for Large Processes, Imports, Images, and Hosting Limits
Not every memory error is caused by normal page loading.
Some operations temporarily require much more memory.
Examples include:
- large XML or CSV imports,
- WooCommerce product imports,
- backup creation,
- malware scans,
- image regeneration,
- bulk optimization,
- database cleanup,
- site migrations,
- and page builder operations.
If the error appears only during one specific operation, increasing PHP memory slightly may help.
However, you should also reduce the workload where possible.
For example:
- split a large import into smaller files,
- process fewer images at once,
- run backup jobs during low-traffic periods,
- remove unnecessary plugins,
- and avoid running several resource-heavy tools simultaneously.
If your site regularly reaches memory limits during normal traffic, your hosting plan may no longer provide enough resources.
What Memory Limit Should WordPress Use?
There is no single correct memory limit for every WordPress website.
A simple blog may require far less memory than a WooCommerce store, membership site, LMS, multilingual website, or page-builder-heavy site.
Typical configurations commonly fall somewhere around:
- 128 MB for lighter installations,
- 256 MB for many standard WordPress sites,
- and higher values for demanding administrative operations or complex sites.
The goal should not be to assign the largest possible number.
The correct value is enough memory for normal workloads while still identifying inefficient code or processes when usage becomes abnormal.
Why Increasing WordPress Memory Sometimes Does Not Work
You may add:
define( 'WP_MEMORY_LIMIT', '256M' );
and still see the same error.
Possible reasons include:
- your host has a lower server-level PHP limit,
- the PHP configuration file overrides WordPress,
- your hosting plan restricts memory,
- the error is caused by a runaway process,
- or the configured value is already high enough and something else is wrong.
Check the actual memory value in Site Health after making the change.
If it does not change, contact your host.
Can a Plugin Cause WordPress to Use Unlimited Memory?
A plugin cannot literally use unlimited memory when PHP has a configured limit.
However, faulty code can repeatedly load data, perform huge database queries, process very large arrays, or create loops until PHP reaches that limit.
This is why increasing memory can sometimes make the site work temporarily without truly fixing the issue.
If memory usage continues growing after every increase, stop raising the limit and identify the plugin, theme, or process responsible.
Can WordPress Memory Errors Cause a White Screen?
Yes.
If PHP cannot complete a request because it runs out of memory, the site may display a fatal error, a critical error message, a blank page, or a white screen depending on the server configuration.
If your site is completely blank, see our WordPress White Screen of Death? 9 Fixes guide.
If the server returns an HTTP 500 response instead, see our WordPress 500 Internal Server Error? 8 Fixes guide.
Final Checklist
If WordPress displays an allowed memory size exhausted error, work through these steps:
- Check the current PHP memory limit.
- Increase
WP_MEMORY_LIMITif appropriate. - Review the server-level
memory_limit. - Disable heavy or recently changed plugins.
- Test the active theme.
- Update WordPress, plugins, themes, and PHP carefully.
- Reduce unusually large processes and review your hosting resources.
If increasing the memory limit fixes the site only temporarily, keep investigating. A healthy WordPress installation should not require constantly increasing PHP memory just to perform normal page loads.