How To Fix The Allowed Memory Size Exhausted Error in WordPress

You are on this page because you saw an error on your WordPress site that looked like following,

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348919 bytes) in /home/some_directory/public_html/wp-includes/plugin.php on line some_directory

This issue normally arises while activating a new plugin or when a plugin is working but runs out of memory to complete its task. The memory limit WordPress is, by default, 32M. So, if a plugin needs memory more then 32M, then the above error arises.

To fix this memory size exhausted error, open wp-config.php file in your root directory on your web host, and add the following line in it.

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

This line tells WordPress to increase the memory limit to 64M, thus fixing the error.

If you are still getting the memory size exhausted error, even after increasing the memory limit, then there is something really wrong with one of your plugins.

To find the culprit plugin deactivate all your plugins, then activate them one by one, checking the site after each plugin’s activation. You’ll be able to find the plugin that is causing the problem. Then either use some other plugin that does the same job, or contact me to fix it.

Important Note - You need to login to WordPress admin panel (dashboard) to deactivate the plugins. But sometimes you can’t even login to WordPress dashboard due to this issue. If this is the case, then use any FTP program to rename all your plugins’ folders. Renaming the folders will deactivate all the plugins automatically. Now rename the directories to their original name one by one, like I explained above, to find the plugin that is causing the problem. I know that the procedure is time consuming, but its the only way to find the problematic plugin. Sometimes the error message can tell directly the faulty plugin, but you need some experience in WordPress development to find out that. You can contact me if you are uncomfortable with troubleshooting this issue yourself.

share on twitter

2 Responses to “How To Fix The Allowed Memory Size Exhausted Error in WordPress”

  1. Toan says:

    Thanks for tut :) I’ll try this error.

  2. Shalina from UK Short Breaks Deals says:

    Hi there

    Thanks for the tip. I had the memory problem after upgrading from WP 2.7 to WP 3.1 and upgrading plugins.

    Rather than increase the memory I decided to use your tip of disabling plugins and in my case it was the WP Super Cache plugin which was causing the problem. I disabled it and all was ok once again!

    Shalina

Leave a Reply