How to Increase WordPress Memory Limits

David Bullock — 

Computer MemoryOut of the box, your WordPress site is typically configured to limit itself to only using 40MB of RAM on your server. This is in many ways ideal, because you don’t want each site hit to consume an immense amount of resources, just the minimum it needs. Too much memory and your site risks becoming slow and bloated. Too little memory, and your site risks a bad case of Early Onset Senior Moments.

How to Tell if Your Site Needs a Shot of more Memory

If your site is behaving slowly, or pages fail to load or you get random “white screens of death”, you may need more memory. Your site’s memory is consumed by three things: your site’s code, the data that your site use to run all those themes and plugins, and your member data for your logged in members. It’s easy to make sweeping generalizations, but the truth is that the mix of things on each site is unique so we’ll cover some guidelines but there is no black and white rule.

Many Plugins

If you have many plugins, even if they’re small, light, fairy-like plugins that barely leave a footprint in the snow, they can add up quickly and run you low on memory.

Drag and Drop Themes

Most themes are fairly light on memory. If you’re using a drag-and-drop theme or marketing framework, just keep in mind that all that capability does come at a cost and you are definitely paying it. Examples include Thrive Themes, Divi, Visual Composer, OptimizePress, etc.

Complex Plugins

If you’re running more than one complex feature loaded plugin like Memberium, WooCommerce, etc. then you may also be skating on thin memory ice.

How to Rejuvenate Your Site Memory

The key to taking control of your memory back is the wp-config.php file located in the home directory of your WordPress site. This file cannot be edited IN WordPress, you’ll need to use your Cpanel, SFTP or FTP account to go in and edit it. This file is full of sensitive configuration information, which needs to be kept intact.

You will want to add the following line near the beginning of your wp-config.php file. If the line already exists, then edit the existing line.

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

If your WP_MEMORY_LIMIT line is already at 64M or higher, then increase it by 16M-32M each time, so 80M, 96M, etc. It’s important to include the “M” in the number. We don’t make these rules.

Many web hosts will let you go up to 256M. Don’t jump straight to 256M.

Pro Tip
If you need more than 256M, then there may be something else wrong and you should reach out to us at support.

We’ve seen customers allocate 1024M. That’s just a crazy large amount of memory and over-allocating memory like that can cause issues as well. Memory allocation is like wine, too little and people are grumpy, just the right amount and everyone’s happy, too much and you’re dancing on tables wearing only a lampshade.

Pro Tip
Don’t dance on tables wearing only a lampshade. #ChocolateMartinis

If you’re not comfortable with editing the config file, then go to Support and submit a support ticket and we’ll take care of it for you. Our team of ninjas eat wp-config files for breakfast, no lampshades necessary.

Pro Tip Trifecta
Be sure to include your CPanel/SFTP/FTP information.

Be sure to test the logins before sending it and include all the information.

The number one cause of delays in ticket handling is missing or wrong login information.