WordPress Error “Allowed memory size of XXXXXX bytes exhausted” Resolution

With recent versions of WordPress the error message has started displaying in Dashboard.

“Fatal Error: Allowed memory size of XXXXXX bytes exhausted (tried to allocate YYYY bytes)”

By default WordPress tries to allocate 32MB to PHP. You would need to manually increase the allocated memory to fix the error.

Option1 –

  • Go to your WordPress root directory and open wp-settings.php for editing.
  • Look for  define(‘WP_MEMORY_LIMIT’, ’32M’);
  • Change the line to define(‘WP_MEMORY_LIMIT’, ’128M’);. This really depends on how much memory is needed. 64M should be enough in some cases. Others might need higher memory allocated.

Option2 –

  • Go to your WordPress root directory and open wp-config.php for editing.
  • Add a line define(‘WP_MEMORY_LIMIT’, ’128M’);. Again, this really depends on how much memory is needed. 64M should be enough in some cases. Others might need higher memory allocated.

These changes will not work if your web hosting provider has restriction on allocated memory. You would need to check with your web host in such cases.

Related Posts

Post a comment or leave a trackback: Trackback URL.

Post a Comment

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

*
*