[3 Easy Method] Fix The WordPress Memory Exhausted Error

3 Easy Method Fix The WordPress Memory Exhausted Error | TechReviewGarden

Looking for a way to fix the WordPress memory exhausted error? Follow our 3 easy methods to do that without any technical experience. You’re at risk of getting the fatal error: “Fatal Error: Allowed Memory Size Exhausted” on your WordPress site.

In this post, we will show you how to increase your PHP memory limit on your server so you can solve the issue. If you are experiencing the WordPress Exhausted Error, or if you want to know how to increase the memory limit on your WordPress website, read on!

Fix-The-Wordpress-Memory-Exhausted-Error-in-or-PHP-memory-limit
Source: Freepik

Many people see Memory Limit Exhausted Error in WordPress while working on a WordPress website because the default allocated memory is limited. Sometimes it’s called WordPress memory exhausted error by increasing PHP memory limit.

To prevent this error from occurring again, we need to increase the allocated memory limit in WordPress so that we have enough memory for our applications to use. You may have seen the error message, “Allowed memory size of 66221131 bytes.” when trying to upload or update files.

Fatal error
Allowed memory size of 66221131 bytes exhausted (tried to allocate 2348617 bytes) 
in/home4/yyy/public_html/wp-includes/function.php on line 272

A Good Introduction to “PHP Memory Limit”

If you see a “WordPress Memory Limit Error”, it means that your WordPress site is trying to use more memory than your server has available. PHP requires memory for it to process WordPress interrogations, perform calculations, and more.

WordPress’s default memory limit is 32MB but it is normal if you need to raise the default limit. For example, WooCommerce recommends a WordPress memory limit of 64MB.

When WordPress reaches its default memory limit—40MB for single-site installations and 64MB for multisite installations—it will try to raise it to 40MB for single-site installations and 64MB for multisite installations. If that isn’t enough, a fatal error message line will appear.

If you have not installed any plugins that use more memory, 128MB should be sufficient for most pages. The Server IP & Memory Use Display plugin will show you how much memory each plugin consumes.

The Server IP and Memory Usage Display plugin can be deactivated to see how it affects memory use. If you have a large number of plugins, all-in-one plugins can make efficient use of memory.

Why You’re Seeing a “Fatal Error Allowed Memory Size Exhausted” Error?

The “Fatal Error Allowed Memory Size Exhausted” error is caused by a PHP script trying to use more memory than allowed by the server. This can happen when the script is trying to do too much at once, such as loading a large file or processing a lot of data. It can also happen if the script is poorly written and doesn’t release memory properly.

Fatal-Error-Allowed-Memory-Size-Exhausted
Source: TechReviewGarden

If you see this error, you will need to increase the memory limit for PHP on your server. You can do this by editing the php.ini file and changing the line that says “memory_limit” to a higher number. For example, you could change it to “memory_limit = 128M”.

This typically occurs when hosting large, high-traffic websites on smallish shared hosting servers that offer small amounts of Memory to each hosting package.

Why is My WordPress Website Slow?

There are many possible reasons why your WordPress website might be slow. One possibility is that you have reached your website memory limit. This can happen if you have a lot of plugins or a lot of traffic to your site. If this is the case, you will need to increase your memory limit in order to speed up your site.

Another possibility is that you have a lot of large images on your site. These images can take up a lot of space and cause your site to load slowly. Try compressing your images to reduce their file size and speed up your site.

Why Does WordPress Require More Memory to Run?

When you want to increase the WordPress memory limit, you should increase the maximum upload size in your wp-config.php file. However, be aware that increasing this value can make it harder for WordPress to identify inefficiencies.

Before increasing the WordPress Memory Limit, We recommend that you first try to figure out what is using more memory. If you have plans to upgrade the host, this could end up costing much more in the long term. 

Any inefficiencies could contribute to your slow load times or bad user experience. But if you want to get the solution you need, then identifying the root of the problem is crucial.

WordPress has been around for a long time and continues to be used by millions of people. However, only 4.4% of websites that use WordPress update their PHP to the latest version, and 64% still use the older version, even though it no longer receives updates. 

Upgrading your hosting server’s PHP to the latest version would make WordPress more efficient and improve performance, which would eliminate the need to buy additional memory for your hosting account.

Maximum Upload Limit in WordPress

WordPress limits the size of files you can upload to your site. You can find this limit on the media library screen or through the WordPress dashboard. Large image file uploads are often slow, so it pays to know this figure!

Solution: “WordPress Memory Exhausted Error”

In some cases, the solution to the WordPress memory exhausted error is to edit the wp-config.php, .htaccess file, and php.ini files. Another solution is the use of the wp maximum upload file size plugin.

In this section, you will learn about three methods to fix the WordPress memory exhausted error and increase the WordPress memory limit.

Please keep in mind that make a backup of your website’s data before editing the files.

Edit the wp-config.php File to Resolve the WordPress Memory Limit

You must edit the wp-config.php file in your WordPress website’s root folder. This file is located on your hosting server, and you can access it via your Web Control panel or FTP Client. For example, go to Cpanel and then file manager, to show you this method.

public_html
Source: TechReviewGarden

 

Now you will see the public_html folder, double-click on that folder. Now right-click on it and select edit. To increase your WordPress website’s memory limit, enter the following code and click on the Save Changes button.

define( 'WP_MEMORY_LIMIT', '256M' );

You will see that the memory limit has increased on your WordPress website. Try another way if this one is failed.

Edit .htaccess File to Fix WordPress Error

The .htaccess file is within the root directory of your WordPress files, where Wp-config.php is located. To access this file, you will have to carry out the same procedure as when accessing Wp-config.php.

Go to your web hosting control panel and click on File Manager. There, you’ll see a file named .htaccess, right-click it and select “Edit.”

Edit-htaccess-File-to-Fix-WordPress-Error
Source: TechReviewGarden

To increase your memory limit, type the following code at the end of this code. Now click on the save changes button

php_value memory_limit 256M

If you are still having problems increasing your memory limit after you have tried both the wp-config.php file and the .htaccess file, then try the next method.

Edit php.ini File to Increase PHP Memory Limit

To edit the php.ini file, you must access the root folder of your WordPress website.

To find the php.ini file, go to your Web hosting control panel and click on File manager. You will see it in the folder where you store your files. Right-click on it, and then click on Edit.

To increase your memory limit, type the following code at the end of this code. Now click on the save changes button. 

memory_limit = 512M

This is how you can increase your WordPress website’s memory limit.

If all of these solutions do not work, it means your hosting provider does not allow WordPress to increase the PHP memory limit. Contact your hosting provider to increase your PHP memory limit manually.

Fix 6 Common WordPress Errors

If you’re looking for more tips on how to fix WordPress errors, we’ve got you covered. Check out our following post on common WordPress errors and how to fix them.

Are You Looking For Best Web Hosting Providers?

Final Words: Fix The WordPress Memory Exhausted Error

If increasing the PHP memory limit does not work for you, then your web hosting service provider may not allow WordPress to increase the PHP memory limit. You will need to ask your web hosting provider to increase this manually.

They’ll help you identify and configure settings that need to be changed. However, editing the wp-config file is the easiest method of increasing the wp memory limit for your website.

If you have any questions regarding any issues, let us know by commenting below. We’ll be happy to help you solve your problem. Thanks for reading this article.

Share This Post

Subscribe To Our Newsletter

Get More Update and Stay Connected with Us

Related Posts
Subscribe To Our Newsletter
Share This Post
Scroll to Top