Do you need to increase the memory limit in WordPress? Getting an error about memory Exhausted? The memory limit is one of the most common WordPress errors as the default limit of memory in WordPress is only set to 64mb!
But there's good news! The Memory Exhausted error is one of the easiest to fix by increasing the default memory limit in WordPress.
WordPress is written in PHP, a server-side programming language. PHP has a default memory limit, that here at FreshSites we set to 1GB on all of our WordPress hosting, but to get this limit beyond 64MB you will need to update the WordPress memory limit. This limit is important to allow your WordPress plugins and themes to function properly.
When your installation of WordPress requires more than the default 64MB of memory, You will see the following error:
To increase the default WordPress memory limit, you will need to find and edit your wp-config.php file.
With our UK WordPress hosting, you can login to your cPanel control panel and use the file manager to edit the file directly. You can also use FTP to connect to your site and go to the public_html folder and download the file, edit and upload.
When editing the wp-config.php file, just after the line
Add the following code:
This code tells WordPress it can use a PHP memory limit of 256MB which gives much more headroom than the WordPress default memory limit of 64MB.
Once this code has been added and saved/uploaded you can instantly try the WordPress site again and the memory exhausted error should stop appearing.
Note: If this coding fix does not work for you, then this means your web hosting service provider does not allow WordPress to increase PHP memory limit. You will need to ask your web hosting provider to increase your PHP memory limit manually. If your having trouble, check out our UK WordPress hosting with a 1GB memory limit.