How to increase the WordPress memory limit, and why you should
Some of the most common WordPress errors are related to a lack of available memory. Sometimes this results in the ‘Allowed memory size exhausted’ error, or the ‘fatal error: allowed memory size of … bytes exhausted’ error, or even the dreaded White Screen of Death.
All of these errors are specifically related to how much PHP memory WordPress needs compared how much it is able to use (although the White Screen of Death could also be the result of a PHP error).
Fun fact: by default WordPress only has a 40MB memory limit. This means that all your theme functions and plugins have a maximum of 40MB to play with. For small, low traffic websites with a handful of good plugins, this may not be an issue. Going beyond that, it is recommended that you increase the amount of memory that WordPress can use.
But before you can increase the WordPress memory limit, you will need to know how much PHP memory your hosting account has afforded you. Depending on your website host, this could be as low as 64MB, but most good web hosting providers should at least be offering a minimum of 128MB.
Once we know how much PHP memory the hosting has, we can increase the WordPress memory limit to match. There are two ways you can find out:
WordPress 5.2 or higher
Go to Tools -> Site Health and hit the Info tab. Scroll down and expand Server and note the PHP memory limit value. This is what you’ll have at your disposal.
WordPress 5.1.1 and lower
Install the WP System plugin, activate it, go to Tools -> WP System and scroll down to PHP memory.
You can deactivate and delete this plugin once you’ve noted the memory limit (in this example, 256M can be used).
Now that you know the memory limit of the hosting account, you can force WordPress to take advantage of it.
To do that you’ll need to edit wp-config.php in your website root and add this line anywhere after where it says “That’s all, stop editing! Happy blogging.”…
define( 'WP_MEMORY_LIMIT', '256M' );
…and save the file.
In this particular case the memory limit is 256M, but you’ll need to change that value to match the actual PHP memory limit of your own hosting account.
Once you’ve done that there is nothing else to configure. Your WordPress installation should now have more memory for running PHP scripts, resulting in less likelihood of your website falling over due to memory limitations.
Task Rocket June Updates (v220.127.116.11)
Task Rocket has received an update to the contextual secondary navigation user interface. It’s about time.Keep reading
Lessons I’ve learned from supporting my own WordPress plugins
As the developer, you want to give the best possible level of support to your customers, but often due to circumstances out of your control, it can be impossible or extremely difficult.Keep reading
How to include a custom stylesheet for any given page in WordPress
One of my biggest pet peeves with website presentation is how inefficient it can be to manage. Let’s see if we can improve the situation.Keep reading
Meet the Rocket Apps plugin manager
The Rocket Apps plugin manager idea was spawned after I received a few complaints about how much side nav real-estate the plugins were using. I could not agree more.Keep reading
A change of direction, and some important product update information
Starting today, Rocket Apps will be launching an updated website and a new business model. The primary products, both Task Rocket and Invoice Rocket, will now be free.Keep reading
Introducing Open Graphite Pro for WordPress
Social sharing can critically important to bringing users to your website and converting, but unfortunately not all websites are putting their best social foot forward.Keep reading