WordPress Fatal error: Allowed memory size exhausted

Square

what is Allowed memory size exhausted error in WordPress ?

This is one of the most common errors that is hard-to-fix problem especially with applications that process large amounts of data.  some theme customizers display a white blank page instead of displaying the desired output. By default, WordPress automatically tries to increase PHP memory limit if it is less than 64MB. However, 64MB is often not high enough.. It is very common to exceed this limit and get the error

If you aren’t sure what is  your PHP memory limit,  the limit is described in the  error message in bytes, so this is the conversion for you to make things simpler:

  • PHP: Fatal Error: Allowed Memory Size of 8388608 Bytes Exhausted – 8 MB
  • PHP: Fatal Error: Allowed Memory Size of 16777216 Bytes Exhausted – 16 MB
  • PHP: Fatal Error: Allowed Memory Size of 33554432 Bytes Exhausted – 32 MB
  • PHP: Fatal Error: Allowed Memory Size of 67108864 Bytes Exhausted – 64 MB
  • PHP: Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted – 128 MB
  • PHP: Fatal Error: Allowed Memory Size of 268435456 Bytes Exhausted – 256 MB
  • PHP: Fatal Error: Allowed Memory Size of 536870912 Bytes Exhausted – 512 MB
  • PHP: Fatal Error: Allowed Memory Size of 1073741824 Bytes Exhausted – 1 GB

After viewing the error message you will be able to determine the memory limit of your site.

How to resolve the Allowed memory size exhausted error in WordPress

The most basic step is to try to increase the memory limit.

First and foremost you need to edit the wp-config.php file on your WordPress site. Which is located in your WordPress site’s root folder, and you will need to use an FTP client or file manager in your web hosting control panel.

Next, you need to paste this code in wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging.’

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

This code tells WordPress to increase the PHP memory limit to 256MB.

Once you are done, you need to save your changes and upload your wp-config.php file back to your server.

You can now visit your WordPress site and memory exhausted error should disappear now.

Note: If this solution does not work for you, then this means your web hosting service provider does not allow WordPress to increase PHP memory limit. You will need to ask your web hosting provider to increase your PHP memory limit manually.

Happy WordPressing

Leave a Reply

Your email address will not be published. Required fields are marked *