Internal Error 500 or WordPress Memory Exhausted Error

When your WordPress code requires more memory than the default allocated memory, you get to see this error such as Internal Error 500 or Allowed memory size of … bytes exhausted (tried to allocate … bytes) in /… on line …

By default, WordPress automatically tries to increase PHP memory limit if it is less than 64MB. However, 64MB is often not high enough.

Increase PHP Memory Limit in WordPress

First you need to edit the wp-config.php file on your WordPress site. It 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');

WP_MEMORY_LIMIT increases the default memory for front-end and back-end operations.

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

This way you don’t allocate too much memory to frontend operations that could end up affecting performance

This should solve the issue you're having. Remember, this can happen to any themes or plugin out there. It also depends on your hosting.

Last updated on 20th October 2020

Please enter a valid email address.

Divi Supreme

We support Divi’s mission through the development of Divi custom modules and Divi child themes that focus on beauty, subtle animations and visitor engagement.

Learn More

Need Help?

Still have a question? Contact Divi Supreme's support. We will try our best to answer your question as soon as possible.