How to Increase Your WordPress and PHP Memory Limit

May 19, 2011 / WordPress


WordPress is a great blogging tool or a content publishing platform that comes with a rich set of features. Using the inbuilt appealing features you can create a professional looking site or blog just within few steps.

WordPress is a script that is included in the Softaculous or Fantastico software which is offered for free with any cPanel Web Hosting package. Usually, WordPress has a default memory limit of 32MB, which is not sufficient when you increase the number of plugins or when your blog traffic increases tremendously.

WordPress Blog Stops Functioning and Shows Error

Fatal error: Allowed memory size of 33554432 bytes exhausted

In such case, most of the times people either open a ticket at the HelpDesk and wait for the response from their uk web hosting provider. Some people try to make changes in the .htaccess file and corrupts whole WordPress blog. Before doing any changes to the WordPress files the user should always backup the WordPress data.
The above issue can be solved by navigating to the wp-config.php file usually which is located at the WordPress installed folder. Edit the file using SSH or the File Manager and add the following line to the wp-config.php file.

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

The above memory limit can be set up to 32MB, 40MB, 64MB or 128MB.

If you are on a cPanel shared hosting plan, you will need to ask your web hosting provider to increase the memory limit. If your WordPress is on a self-hosted plan, then you can increase the memory as long as you want, but should not exceed the RAM allocated to your dedicated server.

Since the WordPress is a collection of PHP based files, you will need to increase the memory limit of PHP as well. If your WordPress is self-hosted, but have multiple blogs installed, you will have to to assign enough memory in order to handle all the installations.

On the cpanel servers, you will find the PHP file located at the following location:


Simply, find the below line in the file:

memory_limit =

Allocate the memory limit according to your requirements. Since, we have allocated 64MB of memory in the above example, in PHP file we will allocate the same amount of memory to PHP.

memory_limit = 64M

Accordingly, if you are having 2 WordPress blogs consuming 64MB memory each, you may set the PHP memory limit to 128MB as shown below:

memory_limit = 128M

Once you are done with the above steps, simply refreshing your WordPress blog will solve the memory limit error.

Spread the love