Are you seeing an allowed memory size exhausted error in WordPress? This is one of the most common WordPress errors, and you can easily fix it by increasing the php memory limit in WordPress. In this article, we will show you how to fix WordPress memory exhausted error by increasing PHP memory.
What is WordPress Memory Exhausted Error?
WordPress is written in PHP, which is a server-side programming language. Every website needs a WordPress hosting server for it to function properly.
Web servers are just like any other computer. They need memory to efficiently run multiple applications at the same time. Server administrators allocate specific memory size to different applications including PHP.
When your WordPress code requires more memory than the default allocated memory, you get to see this error.
By default, WordPress automatically tries to increase PHP memory limit if it is less than 64MB. However, 64MB is often not high enough.
Having said that, let’s see how to easily increase PHP memory limit in WordPress to avoid memory exhausted error.
Increase PHP Memory Limit in WordPress
We have 2 diffrent methods to solve the wordpress memory limit problem.
Method 1: If you are using linux based hosting, and using cPanel control panel then follow the first method.
a. At first login to your cPanel.
b. Then select “MultiPHP INI Editor” from the software section.
c. Then select your website from the drop-down list.
d. Then search for “memory_limit” PHP Directive and set the limit 256M
e. Then don’t forget to click on “Apply”
Method 2: If you are using custom control panel, or using Plesk, Direct Admin etc, then follow this steps.
a. First you need to edit the wp-config.php file on your WordPress site. It is located in your WordPress site’s root folder, and you will need to use an FTP client or file manager in your web hosting control panel.
b. Next, you need to paste this code in wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging.’
This code tells WordPress to increase the PHP memory limit to 256MB.
c. Once you are done, you need to save your changes and upload your wp-config.php file back to your server.
d. You can now visit your WordPress site and memory exhausted error should disappear now.
Conclution: That’s all we hope this article helped you solve WordPress memory exhausted error by increasing PHP memory limit.