Increasing Memory Allocated to WordPress

February 13, 2017


Increasing Memory Allocated to WordPress

David Curtiss

The WP_MEMORY_LIMIT option allows you to specify the maximum amount of memory that can be consumed by PHP. This setting may be necessary in the event you receive a message such as “Allowed memory size of xxxxxx bytes exhausted”.

This setting increases PHP Memory only for WordPress, not other applications. By default, WordPress will attempt to increase memory allocated to PHP to 40MB (code is at beginning of wp-settings.php), so the setting in wp-config.php should reflect something higher than 40MB.

WordPress will automatically check if PHP has been allocated less memory than the entered value before utilizing this function. For example, if PHP has been allocated 64MB, there is no need to set this value to 64M as WordPress will automatically use all 64MB if need be.

When in the administration area, the memory can be increased or decreased from the WP_MEMORY_LIMIT by defining WP_MAX_MEMORY_LIMIT.

Note: These are two different settings mentioned above though taken directly from the WordPress codex and obviously not clear about it – we found that one should use them BOTH – for example setting the WordPress memory limit to 1024M one needs to add both:

define('WP_MEMORY_LIMIT', '1024M');
define( 'WP_MAX_MEMORY_LIMIT', '1024M' );

Note 2: The “define” statement goes into your wp-config.php file somewhere just above the /* That’s all, stop editing! Happy blogging. */ statement. Alternatively one may see other define statements there – simply add to the bottom of the list.

Please note, this setting may not work if your host does not allow for increasing the PHP memory limit–in that event, contact your host to increase the PHP memory limit. Also, note that many hosts set the PHP limit at 8MB. Here at Western Web Doc we set ours at 1024MB

That’s it! Make sure to check out our other tutorials for more WordPress tips & tricks.

Want new articles before they get published?
Subscribe to our Awesome Newsletter.

WebDoc Hosting

WebDoc Security

By David Curtiss

I am a freelance website designer and developer. I enjoy helping people start businesses and writing about entrepreneurship.

Related Articles

1 Comment

  1. Jan Zac

    Hello ,

    I saw your tweets and thought I will check your website. Have to say it looks very good!
    I’m also interested in this topic and have recently started my journey as young entrepreneur.

    I’m also looking for the ways on how to promote my website. I have tried AdSense and Facebok Ads, however it is getting very expensive. Was thinking about starting using analytics. Do you recommend it?
    Can you recommend something what works best for you?

    I also want to improve SEO of my website. Would appreciate, if you can have a quick look at my website and give me an advice what I should improve:
    (Recently I have added a new page about FutureNet and the way how users can make money on this social networking portal.)

    I have subscribed to your newsletter. 🙂

    Hope to hear from you soon.

    Maybe I will add link to your website on my website and you will add link to my website on your website? It will improve SEO of our websites, right? What do you think?

    Jan Zac


Submit a Comment

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

Pin It on Pinterest

Share This