WordPress Memory Exhausted Error: 5 Easy Ways to Fix It

Affiliate Disclosure: Some links on this page are affiliate links. If you purchase through our links, we may earn a commission at no extra cost to you.

Last updated: December 4, 2026 · Reading time: about 10 minutes

The WordPress memory exhausted error means a PHP script tried to use more memory than your site is allowed. Fix it by raising the limit: add define('WP_MEMORY_LIMIT', '256M'); to wp-config.php, or raise memory_limit in your hosting panel. If it returns, find the plugin or theme that uses too much memory.

Key takeaways

  • The message reads “Allowed memory size of X bytes exhausted”. X is your current limit.
  • Raising the limit is a fix for the symptom. A plugin that leaks memory is the usual cause.
  • Three places can set the limit: wp-config.php, php.ini or .user.ini, and the hosting panel. The host’s value wins if it is lower.
  • Deactivate plugins one at a time to find the culprit.
  • Check the result in Tools, Site Health, Info, Server, where WordPress shows the real limit.
WordPress memory exhausted error flow: how a PHP script exceeds the memory limit
The number in the message is your current limit.

What does the WordPress memory exhausted error mean?

Every PHP request gets a memory budget. When a plugin, a theme or a heavy task such as an import or image processing goes over that budget, PHP stops the script and prints the error. The number in the message is your current limit in bytes: 33554432 is 32 MB, 67108864 is 64 MB and 134217728 is 128 MB.

The error usually shows the file and line where the limit was hit. That file is where PHP ran out, not always where the problem started. A plugin path in the message is a strong hint, though.

Why does it happen?

The common causes are a low default limit on the hosting plan, a heavy plugin, a page builder or WooCommerce on a small plan, large image processing, big imports and a plugin loop or bug.

A low default limit

Some hosts start accounts with 32 or 64 MB. That is enough for a plain blog and not for a store or a page builder.

A plugin that uses too much

Backup, import, security scan and gallery plugins run heavy jobs. A bug can also make a plugin allocate memory in a loop.

Large uploads and image processing

WordPress resizes every upload into several sizes. A very large photo can use far more memory than its file size suggests.

Admin tasks

The dashboard has a separate limit, WP_MAX_MEMORY_LIMIT, which is higher by default. Errors that only appear in wp-admin point to updates, imports or the editor.

How do you fix the WordPress memory exhausted error?

Raise the limit in wp-config.php first. If the value does not change, raise it in php.ini, .user.ini or .htaccess, or in the hosting panel, or ask support.

Table of five ways to raise the WordPress memory limit
Start with the first two rows.

Method 1: wp-config.php

Back up the file, then add this line above the comment that says “That’s all, stop editing”:

define('WP_MEMORY_LIMIT', '256M');

Save and reload the page. Our guide on how to back up a WordPress site explains how to take that backup.

Method 2: the hosting panel

Many panels have a PHP options page where memory_limit is a drop-down. Choose 256M and save. This is the most reliable method on managed hosting, because the host’s setting overrides the others.

Method 3: php.ini or .user.ini

If your host allows it, add memory_limit = 256M to php.ini or .user.ini in the WordPress root. Changes can take a few minutes to apply.

Method 4: .htaccess

On Apache with mod_php you can add php_value memory_limit 256M. On other setups this line causes a 500 error, so only use it when you know your server type, and remove it if the site breaks.

Method 5: ask your host

If none of the above change the value, the host caps it. Send support the exact error and ask for a higher limit.

How do you confirm the new limit?

Open Tools, Site Health, Info, then Server. WordPress lists the PHP memory limit and the value it is actually using. If the number is still low, the setting is being overridden by the host.

Steps to confirm the WordPress memory limit in Site Health
Site Health shows the value WordPress really gets.

What if the WordPress memory exhausted error comes back?

A repeating error means something is using memory it should not. Find it by deactivating plugins one by one, switching to a default theme and reading the error log.

Checklist for finding the plugin that causes the memory exhausted error
A repeating error needs a cause, not just more memory.
  1. Note which action causes the error: a page, the editor, an import or an update.
  2. Deactivate all plugins. If the error stops, reactivate them one at a time.
  3. Switch to a default theme such as Twenty Twenty-Four to rule the theme out.
  4. Read the PHP error log for the file that hits the limit.
  5. Replace or remove the plugin that causes it, or ask its developer for a fix.

If the screen is blank instead of showing a message, follow our guide on the WordPress white screen of death. A bloated site also benefits from the tips in how to speed up a WordPress site.

How much memory does WordPress need?

Official guidance for hosting is at least 128 MB for a basic site. Stores and page builders usually need 256 MB or more. The table gives practical starting points, not guarantees.

Table of suggested WordPress memory limits by site type
Starting points, not guarantees.

How do you prevent the memory exhausted error?

Keep plugins few and updated, test big plugins on staging, resize images before upload and choose a host that sets a sensible limit.

Frequently asked questions

What does allowed memory size exhausted mean?

PHP stopped a script because it used more memory than the limit allows. The number in the message is the limit in bytes.

What memory limit should I set?

256M is a safe choice for most sites, including stores. A small blog can run on 128M.

Why does my change in wp-config.php do nothing?

The host may cap memory at a lower value. Check Site Health, Info, Server and set the value in the hosting panel or ask support.

Is it safe to raise the memory limit?

Yes, within your plan’s limits. It only allows more memory per request. It does not fix a plugin that wastes it.

Why does the error only appear in the dashboard?

The admin area has its own limit, WP_MAX_MEMORY_LIMIT. Heavy tasks such as updates and imports run there.

Can a plugin cause the error?

Yes, it is the most common cause. Deactivate plugins one at a time to find it.

Will more memory slow my site?

No. The limit is a ceiling, not an amount that is used all the time.

What if I cannot reach the dashboard?

Edit wp-config.php through the file manager or SFTP, or rename the plugins folder to deactivate all plugins, then rename it back.

Sources and further reading

Summary

The error is a limit, not a break. Raise the memory limit in wp-config.php or the hosting panel, confirm it in Site Health, and if the error returns, find the plugin that uses too much. Back up first, change one thing at a time and test after each change.

About the author: Mo Abdlhamid works on websites and online business in Egypt and writes the guides on CMS Ideas. This guide is based on the WordPress and PHP documentation linked above. We did not run a timed test on every host panel for it. Last reviewed December 4, 2026.

Leave a Comment