How to increase Memory Limit in your Blog? [WordPress TIP]

by on June 26, 2011

in Wordpress Tutorials

As your blog gets more popular among the audiences, it crosses new milestones, out of which the most important and the most loved by the bloggers is the rise in traffic. As you get a hike in the online traffic, blog visitors may start experiencing downtimes and timeouts, especially if you are on a shared hosting (like me! ;) ), which may get annoying sometimes and in turn, you may end up losing some loyal visitors.

Wordpress-Error-Tips

Increase the WordPress Memory Limit

One of the tweaks you can make to counter this problem, is to increase the memory limit for your server. The wordpress default memory limit is 32MB. This default memory limit can become a problem for your server once your blog gains traffic. To increase the amount of memory limit allowed in PHP, you need to add the below simple line of code in your wp-config file, which is located in the root directory of your WordPress blog installation.

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

Please note that in the above example, the memory limit has been set at 96MB. You can set anything in the multiples of 8MB; like 64MB, 128MB etc.

Increase the PHP Memory Limit

After you have made the changes for the WP Memory Limit, you also need to make the changes to the PHP Memory limit. For this, you need to edit php.ini file on your self hosted server.

In the php.ini file find the line “memory_limit=” and make the changes as below:

memory_limit = 96M

Please make sure that the memory limit for PHP needs to match the wordpress installation memory limit, which in this example we took as 96MB, hence for php memory limit also, you need to keep the value as 96M.

If you don’t have access to the php.ini on a shared hosting environment, then you’ll need to ask your host to increase the PHP memory for your WordPress blog.

What is the maximum memory limit you can set?

If you are on a shared hosting platform, you may not have rights to make the above changes, in which case, you need to get in touch with your hosting provider to increase the memory limit. However, if you are on a self hosted platform (VPS), you can increase it till you are not crossing the limit of RAM on your server.

Using this simple tip, you can avoid most of the memory issues on your wordpress blog. Try this and do share with us how this tip helps you in catering the downtimes on your blog.

In case of any issues while implementing this little tweak, feel free to give a shout! :)

Article by Amandeep Singh

Owner of Technolism. A Software Engineer by profession, an Engineer by education and a Web enthusiast and Blogger by Passion. You can catch him on Facebook, Twitter or Google+

Amandeep has written 223 informative articles for Technolism.

Subscribe to our feed via RSS or EMAIL to receive free Email updates.

Subscribe to Technolism Facebook Fan Page or Follow us on Twitter.

{ 6 comments… read them below or add one }

aswin

You gavea blast telling this is only for VPS at end :-)

Reply

Amandeep Singh

This is not only for VPS… but in some cases you may need to contact your host provider :)

Reply

Jasmine

Good tips there! We mostly need to increase the memory limit if we installed too many plugins.

Oh, what will happen if we put something like 200GB as the setting?

Reply

Amandeep Singh

Haha.. nice try, Jasmine ;) But the maximum you can go is the limit of your server RAM :)

Reply

Amit

Hi Aman,Thanks for the great post ,Nice post

Reply

John

A very useful thing that I might need for my blog soon. Thanks for the post.

Reply

Leave a Comment

CommentLuv badge

Previous post:

Next post: