Today we will show you how to fix WordPress Memory Limit Error.
But first, listen to this:
WordPress is a Content Management System that is written in PHP. This programming language is quite versatile, although it does have a few difficulties.
When working with such a system, it is essential to be well-versed with the steps to backup the WordPress websites to be safe after any new update or edits, as this will ensure that even if you get any errors, you can instantly get back to the previous version without having your website users face a downtime.
For example, if you don’t provide your WordPress installation enough memory, you could get the “PHP Memory Exhausted” issue now and then. While using WordPress, you may also face other errors, including the WordPress HTTP Error.
In a word, this issue indicates that your server isn’t supplying enough resources for WordPress to run the PHP programs it requires. This problem can have a detrimental impact on your site’s functionality, but there are a few things you can do to repair or even prevent it.
Causes of WordPress Memory Limit Error
To keep data such as plugins, themes, databases, and content, every website requires a specific amount of RAM. When the resources demand it, more memory is required. The web servers, on the other hand, set a restriction on how much RAM any script can use. WordPress comes with a memory allocation of 64M by default.
The memory limit error occurs when the demand surpasses the limit. This issue usually occurs when you add media assets to your site or when you install a new theme or plugin.
Why do servers set a RAM restriction?
After all, it is a vital component for server security. Servers must have adequate memory to simultaneously run several apps for various websites.
A badly written script without restrictions could take all of the server’s memory. The server breaks in this event bringing your site and all the other sites it hosts down with it. WordPress is dependent on PHP scripts, and therefore must stick to the assigned limits.
Resolving the WordPress Memory limit Error
The good news is that most WordPress issues are simple to diagnose and correct. Nonetheless, they might be scary to newbies, particularly because they provide little information about what went wrong and how to solve the problem. However, following these steps will help you resolve the error in every situation.
Fix 1: Increasing the PHP Memory limit.
You must manually establish a new memory limit for your server to increase the PHP memory limit. Editing the wp-config.php file on the server is required.
To get to the WordPress files on your server, you have two options. You can use either CPanel’s File Manager or an FTP client software. Here is how to do it with the File Manager:
Step 1: To access your CPanel, type /cpanel after your domain name (for example, yourwebsite.com/cpanel). To access CPanel, use the login credentials you received in your welcome email from your web host.
Step 2: Locate the Public.html folder in the File Manager.
Step 3: Right-click on the wp-config.php file and select Edit.
Step 4: Look for the end line specifying the memory or the one stating “That’s it, no more editing!,” and then paste the code underneath it.
define( ‘WP_MEMORY_LIMIT’, ‘256M’ );
This limits PHP memory to 256MB by default.
Step 5: To save your changes, click Save. Reload your website to see whether the error has been resolved.
Fix 2: Disabling and then reactivating the plugins.
The memory exhausted issue is frequently fixed by increasing the PHP memory limit. If not, one of your website’s plugins may be creating the problem. To figure out which plugin is causing the problem, disable all of them and then reactivate them one by one until you find the culprit.
You’ll need to disable the plugins on the server because you can’t access your WordPress dashboard. To do so, you’ll need to re-login to your server. To access your server, follow the steps given below:
Step 1: Locate the plugins folder in the wp-content folder.
Step 2: The plugins folder should be renamed to “plugins-bad.” Don’t worry, none of the plugins you’ve installed will be removed.
Step 3: Make a new, empty folder called plugins. This will turn off all of the plugins that have been installed on your site. Reload your website to see whether the problem has been resolved. If your website is now working normally, the problem was most likely caused by a plugin.
Step 4: Return to the wp-content folder now. Delete the previously created empty folder and rename the “plugins-bad” folder to “plugins.” This will restore your old plugins without requiring them to be activated.
Step 5: Now rename each plugin one by one and see which one caused the error and then delete the same.
Fix 3: Upgrade the Hosting Plan of your Website.
You shouldn’t have to worry about increasing your PHP memory limit if you utilize a good WordPress hosting service. If you use shared hosting, you’ll almost certainly have limited resources. If you’re seeing this problem, it’s probably time to increase your hosting package.
In most cases, upgrading your hosting package will result in more PHP RAM being available. As a result, you’re far less likely to encounter a WordPress memory limit problem. Your budget is the only constraint.
If you are unable to upgrade hosting plans at this time, you should contact your provider’s support team to see if they can increase your PHP memory limit on their end. If they can’t, it’s time to upgrade to another best web hosting provider that offers high PHP memory restrictions on budget rates.
Fix 4: Contact your web hosting provider.
If any of these approaches don’t work for you, it’s because your web hosting company won’t let you boost the PHP memory limit. You’ll have to explicitly request that your web hosting provider boost your PHP memory limit. Contact your web hosting service provider to take help for the same.
Conclusion
It’s aggravating to run across an error on your WordPress site, especially if it doesn’t provide much information. Thankfully, the WordPress memory limit error is a little more lenient than others. It informs you of the exact nature of the problem, and the path to resolving it is relatively clear.