WordPress – Fatal error: Allowed memory size….

This error usually shows up in WordPress in scenarios like changing hosting servers or adding extra plugins that put a strain on your server’s initial php memory limit. The solution is to allocate more PHP memory to your server (don’t confuse this with physical memory like RAM, this is simply a setting that your hosting can help you with).

The are several ways of doing this yourself if for some reason your hosting provider cannot help you:

1. If you have access to your PHP.ini file, change the line in PHP.ini
If your line shows 32M try 64M:


memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)

more info on where to find your php.ini here

2. Another way of doing this is to edit your wp-config.php file and enter the following just at the top of the file:


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

3. Also a method to increase PHP memory limit is through the .htaccess file. You will need to edit your .htaccess and add something like this:


php_value memory_limit 64M

If you tried all these methods and still see the error after clearing cache then contact your hosting provider.

Leave a Reply

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