Website support, maintenance and fixes for UK businessesCall 0208 088 8371info@websupportservices.co.uk

HomeWordPress errorsAllowed memory size exhausted in WordPress: how to fix it

Allowed memory size exhausted in WordPress: how to fix it

This fatal error means a PHP process tried to use more memory than the configured limit allowed. Raising the limit can restore the request, but the important job is to identify why that request needs so much memory.

The message you might see

Fatal error: Allowed memory size of 134217728 bytes exhausted

Different wording, or a file path in the message? Paste it into our free error finder to see which plugin or theme it comes from.

What an allowed memory size exhausted error means

A message such as "Fatal error: Allowed memory size of 134217728 bytes exhausted" means PHP reached its memory ceiling while processing the request. The byte figure is the configured limit at the point of failure. For example, 134217728 bytes is 128 MB.

PHP uses memory_limit to restrict how much memory one script can allocate. WordPress can also request its own memory allowance with WP_MEMORY_LIMIT, but the server's PHP configuration can still impose the effective ceiling. This is why changing only WordPress settings does not always change the value reported in the error.

Common causes of WordPress memory exhaustion

Memory use often rises during image processing, large imports, backups, page builder operations, complex database queries and ecommerce administration. A plugin can also enter an inefficient loop, load a large data set into memory or conflict with another extension. In those cases, increasing the limit may hide the symptom without fixing the underlying fault.

Recent changes matter. If the error started after installing or updating one plugin, changing the theme, importing data or upgrading PHP, test that change first. The file path in the fatal error is useful evidence, but remember that the file named at the point of failure is not always the component that consumed most of the memory.

How to fix a WordPress memory limit error safely

Before editing files or the database, take a full backup of both website files and the database. Then confirm the failing action and change one thing at a time.

  1. Retry the exact action once and note whether the error is repeatable. Check the fatal error path and any recent plugin or theme changes.
  2. Temporarily disable the suspected plugin if the error began after an update or installation. If the failure disappears, investigate that plugin before increasing limits globally.
  3. Check the PHP memory limit in your hosting control panel or PHP configuration. PHP documents memory_limit as the per script allocation limit.
  4. If the server allows it and the site genuinely needs more memory, WordPress can request a higher amount in wp-config.php:
define( 'WP_MEMORY_LIMIT', '256M' );

Use a value supported by your host rather than assuming that a larger number is always better. If you manage the server, the corresponding PHP setting is normally in php.ini, for example:

memory_limit = 256M

After the site is stable, repeat the original task and monitor memory related errors. If consumption keeps climbing, profile or replace the code responsible rather than repeatedly increasing the ceiling.

When to get help with PHP memory exhaustion

Stop if memory errors affect checkout, scheduled jobs or multiple unrelated pages, if the site needs unusually large limits for ordinary requests, or if the reported file is custom code you cannot safely change. Also stop if hosting limits prevent the required setting from taking effect.

Web Support Services offers an Emergency Fix for £249 per incident, with a response within 2 working hours. For ongoing maintenance, backups and monitoring, care plans start from £59 a month.

Common questions

Answers to the questions we hear most about this.

What does 134217728 bytes mean in a WordPress memory error?

It is 128 MB. The message is telling you the PHP process reached the memory limit that applied to that request.

Is increasing WP_MEMORY_LIMIT enough to fix the error?

Not always. The host's PHP memory_limit can cap the effective value, and a plugin or task may still be using excessive memory. Check the cause as well as the limit.

What WordPress memory limit should I use?

There is no single correct value for every site. Use the lowest sensible limit that supports the site's real workload and remains within the host's PHP configuration, then investigate abnormal memory growth.

Site down or showing an error?

Call us now. Emergency Fix is £149 with a response within 2 working hours, and no fix means no fee.

Get website support