How to Increase the PHP Memory Limit in WordPress

On some hosting you’ll notice a ‘Fatal Error : Memory Size Exhausted’ when you install a lot of plugins, upgrade to the latest WordPress version or even you’ll find an error in your Dashboard widget which prevents them from loading fully.

If you face Memory Exhausted problem with your wordpress site then you can increase memory limit with these three method:

1.Changing the Memory Limit via wp-config.php

If you don’t want to mess with the PHP.ini file, then you can go for this method. In this you won’t be needing to create any extra file in your Directory.

Just Adding define(‘WP_MEMORY_LIMIT’, ’64M’); in your ‘wp-config.php’ file would increase your PHP Memory Limit to 64 MB.

2.Increase the limit via PHP.ini file

You can directly increase the PHP Memory Limit if you’ve access to the PHP.ini file. Most small Shared hosting servers won’t give you access to the PHP.ini file. But some servers allow you to create a duplicate PHP.ini in your respective site Directories whose data/values will override the default PHP.ini values.

3.Modifying the .htaccess file to Increase the Memory Limit

A Default WordPress Installation won’t have a .htaccess file. But in case you already have it for some purposes like ‘301 Redirection’ which is an important aspect of WordPress SEO.

In such a case just add the command php_value memory_limit 64M in your ‘.htaccess’ file and your memory limit will increase to 64 MB.

Leave a Reply