What are the options for resolving an exhausted memory size problem in WordPress?
Initially, you may find this confusing, since you won’t know what caused the problem or how it can be fixed.
The good news is that this is one of the simplest issues to resolve, and anyone can do this, no matter how new they are to WordPress.
There is a simple workaround for this WordPress error that involves increasing WordPress’ PHP memory limit.
The purpose of this article is to demonstrate how to fix WordPress memory exhausted error by increasing PHP memory.
The WordPress platform is written in PHP, which is a server-side language. A web server is just like any other computer.
To run multiple applications simultaneously, they need memory. PHP, like other applications, is allocated a specific amount of memory by the server administrator.
The error appears whenever you use more memory than the default memory allocation.
When we speak of PHP memory limits, we mean the amount of server memory that PHP is allocated in order to run scripts. It is recommended to set that number no lower than 64MB. This being said it’s enough in most cases to have 64 MB of RAM.
Adding more PHP memory shouldn’t negatively impact website performance since most hosting servers offer you far more memory than that. As a matter of fact, unless you use a cheap web hosting service, you shouldn’t be worried about your PHP memory limit.
If you access your WordPress dashboard and navigate to Tools > Site Health > Info, you can quickly determine what your PHP memory limit is.
If the memory is low, say 32M, the solution is to increase the memory allocation to your site. Let’s see how to do that!
Changing the WordPress memory limit requires editing the wp-config.php file. The file can be downloaded from the public_html folder of your site, download it and open it with your HTML editor.
When editing the wp-config.php file, identify this line.
‘That’s all, stop editing! Happy blogging.’
Add the following code just above:
define( 'WP_MEMORY_LIMIT', '256M' );
With this code, WordPress is told it can use 256MB of PHP memory instead of the default 64MB. After you add this code and save/upload the wp-config file back.
You can instantly check the WordPress site again and the memory exhausted error should have disappeared.
It is possible that WordPress is unable to increase PHP memory limits due to your web hosting provider.
Then, the PHP memory limit needs to be increased manually by your hosting company, so reach out their support.
I hope this article helped you to increase PHP memory limit to solve the WordPress memory exhaustion error.
You might also like to read my article on How to turning off PHP errors in WordPress.