WordPress Memory Limit Error: What is it and How to Fix it?

Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email

Have you been coming across errors, issues, and problems while using WordPress? 

Well, it’s quite normal. Using an open-source platform like WordPress comes with its advantages and disadvantages. Where it offers unlimited flexibility and scalability, it also demands you to be comfortable with working on technical issues that may arise when using WordPress. You must particularly be able to solve and troubleshoot the most common WordPress errors.

One of the most frequently-encountered WordPress errors is the WordPress memory limit error, which may seem intimidating and confusing. However, once you get to know what it is, what causes it, and how to resolve it, you will find it to be one of the simplest WordPress errors.

Scroll down to learn all about the WordPress Memory limit error and the best methods to resolve it.

What are WordPress Memory Limit Errors?

Even though WordPress is quite a sturdy and well-built platform, it is not completely free of errors. There are many different errors and issues that you may encounter when using WordPress. One such common WordPress issue is the WordPress memory limit error, which is also known as the “PHP memory limit error.’

WordPress requires a certain memory space on your server to work properly. The memory allocated for WordPress is by default 64M. However, sometimes, this memory space is not enough, which results in the display of a WordPress memory limit error as follows:

fatal error: the allowed memory size of 67108864 bytes exhausted

Sometimes, instead of this message, you might also see the maintenance mode or a white screen of death. All of this means the same: you are running out of your memory, and you need to resolve it.

Why have you come across WordPress Memory Limit Error on Your Site?

Each website, regardless of how big or small it is, needs a certain amount of memory space. This memory is required to store all your website data, including the themes, plugins, databases, the content of your website, and much more. No matter the demand of the websites, web hosting servers allocate a specified memory that can be used by any script. Your WordPress website is based on the scripts written in PHP, and they must stick to the allocated memory limit.

WordPress websites have a marked memory space of 64M by default. When the demand surpasses the limitation, you come across the WordPress memory limit error on your website.

The memory shortage for WordPress websites occurs in multiple circumstances. The two primary reasons behind this issue are:

  • Installing and activating any new plugin or theme.
  • Uploading media files and images to your website.

Further, as your WordPress website grows larger and heavier, and you start to use more complex scripts and plugins, your memory may soon run out.

So, why do the servers actually limit the memory space allocation for websites? This specified allocation is necessary to ensure the security and performance of the servers. Every server requires a sufficient amount of memory and storage space in order to run multiple applications for various websites, all at the same time. Moreover, the performance should not be compromised.

WordPress managed cloud hosting with unlimited application-level edits.

Launch your first site for free

If there is no memory allocation, an inadequate script may use up the entire memory of the server. If this happens, the server will eventually crash and take your website down along with all the other websites it hosts. Therefore, the allocation of the memory space limit by web hosting servers is unavoidable. 

How to Check Out Your Current PHP Memory Limit?

In case you are using WordPress 5.2 or any of the versions above it, you can easily check out your current PHP memory limit via the Site Health Tool. Here is how you can do it:

  1. Log into your WordPress Dashboard.
  2. On the left side panel, navigate to ‘Tools.’
  3. Click on the ‘Site Health.’
  4. Click on ‘Info’ at the top.
  5. Scroll down to the ‘Server’ section.
  6. Here, you will see the ‘PHP memory limit’ option, displaying the memory limit for your website.
Source: Web Dev

How to fix the WordPress Memory Limit Error?

Now you know what a WordPress Memory Limit error is and the reason behind it. So, now let us learn the different methods to resolve this error. 

As opposed to many other WordPress errors, the WordPress memory limit problem is quite straightforward to solve. As the reason behind this error is very concise, you will not have to go through a lot of troubleshooting to get rid of this problem.

There are, in fact, only two courses of action you can take when this error is encountered. They are as follows:

  1. You can increase the allocated memory for your website, or 
  2. You can switch to a better web hosting plan. 

Let’s look into these two methods to learn when and how to use them.

Option 1: How BionicWP's Website’s Hosting Plan can help

Source: Web Dev

Every hosting provider offers you a certain amount of resources and features, including the memory limit for your website. Sometimes, these resources become insufficient and are just not enough for your website to function properly. 

That’s where BionicWP’s website hosting plan comes to help you out.

Here at BionicWP, we provide you with managed WordPress hosting solutions customized specifically according to the memory needs of your website. Instead of a shared hosting plan with limited memory, we provide you with a Managed cloud hosting solution. This ensures that your website will have access to a lot more space and a lot more resources. 

Still, if at any point, you feel like you do not have sufficient memory, you can always upgrade your plan. We offer highly flexible solutions that allow you to easily increase the number of resources and the amount of memory space allocated to your website.

The BionicWP’s hosting plans are powered by Google Cloud Platform. BionicWP will not only provide you with a fast, secure, and high-performing hosting solution but will also give you a high default memory limit. So, you can be assured that if your website is hosted with BionicWP, you will not encounter any memory-related issues.

In addition to an increased amount of memory and all other website resources, BionicWP offers you many other benefits:

  • A single platform for managing everything! From hosting to plugins to themes and much more, everything is taken care of by BionicWP.
  •  Guaranteed 90+ Google page speed score
  • Application-level support
  • Unlimited edits
  • Frequent Malware Scanning, WordPress Hardening & WAF Firewall
  • Guaranteed improvement in site performance and conversions
  • Google C2 High Compute Instances with Premium Tier Bandwidth 
  • Nginx + FCGI + PHP 7.4 + MariaDB with LXD – Hyper Optimized Stack  
  • High-performance CDN  
  • A completely white-label solution is also available for resellers.
  • Auto backup to staging and rollback
  • Auto and Managed update of core, theme, plugins 
  • Free staging environment

Moreover, BionicWP also offers a very reasonable and friendly pricing plan where you only have to pay for the websites you actually host on the platform. 

Thinking about switching to BinicWP as your website hosting provider? No worries. We even offer free migrations from various other WordPress website hosts. So, you can easily and freely switch to a much beneficial, flexible, and resourceful web host and get rid of WordPress Memory limit error quickly.

Option 2: Increase the PHP Memory Allocated to Your Website

How to fix a memory limitation issue? The most obvious answer would be to increase the allocated memory space. If your website runs out of memory, the best solution would be to increase the amount of memory accessible to your site. 

The current memory of your website is set in its wp-config.php file. The allocated space set in this file may be different or the same as the value marked by your hosting provider. You can manually increase the memory limit by altering your wp-config file. Here is how you proceed:

WordPress managed cloud hosting with unlimited application-level edits.

Launch your first site for free

  1. Access your Website’s files via an FTP Server
  • Log into your WordPress website using an FTP client or a file manager.
  • Here, we will show you an example of accessing the website using FileZilla. When you access your website through FileZilla, you will see a screen like this:
Source: Web Dev
    2. Find your wp-config.php File
  • The right quadrants of the screen display the list of folders containing your website’s file.
  • Now, navigate to the root folder of your website, and double click to open it. Commonly, the root folder is named as public_html or after your domain name.
Source: Web Dev

This file is very crucial to your website. It contains important information about the settings and database of your website. Hence, you must be careful not to disturb or interfere with any other lines of code while editing this file. Make sure you only make changes to the line we are about to discuss. In fact, it is best to make a backup of your website before going any further. This is to make sure that your website remains safe and secure, even if you accidentally make any changes or delete something important.

    3. Increase your Website’s Memory Limit

  • Once your backup is set up, find and open your wp-config.php file.
  • The wp-config.php looks similar to this:
  • Navigate through your file to find the following line:

define( ‘WP_MEMORY_LIMIT’, ‘256M’ );

  • Do keep in mind that the number in your file might be different from this one, as it will be showing the current memory limit of your particular website. You may even not find the line at all.
  • If you do find this line, increase the number on it to increase the allocated memory of your website. Mostly, 256 MB is sufficient. However, if you do not find this line, you can paste it above the line that says, “That’s all, stop editing! Happy blogging.”
  • Save the edits that you have made, and then exit the editor.

Now, revisit your website and repeat the action you attempted to do before you encountered the memory limit error. If you do not see the error again, congratulations, you have successfully fixed it. 

In case you still come across the same error, repeat the whole procedure and increase the memory a bit more. However, if you keep increasing and it does not work, the chances are that you may have reached the maximum memory limit offered by your hosting provider. In case this happens, then it is best that you go for the first option that we discussed – upgrading your WordPress hosting plan or switching to a better provider, like BionicWP.

Summary

We know and understand how exasperating it can be to come across an error on your WordPress site. It can even be a lot more frustrating if you are not sure about the reason behind it. Luckily for us, that is not the case with the WordPress Memory Limit error. When this issue occurs, you know exactly what the reason behind it is – a shortage of memory space. Thus, you can easily fix the issue. All you would have to do is to follow any one of the two ways of resolving the error.

The two methods of fixing this issue of memory limit are as follows:

  1. Manually increasing your WordPress website memory limit. You can do this by accessing your website through an FTP client, as demonstrated in the guide above.

OR,

      2. Switching to a better and more resourceful WordPress managed hosting solution, like BionicWP.

We hope that this guide proves to be helpful in providing you with all the information regarding the WordPress memory limit error and the best methods to fix it. Nonetheless, if you have any more confusion or queries, get in touch with us today. We will help you with all your WordPress website hosting issues in the best manner possible.

Let us manage your WordPress Website and attain true peace of mind.

Scale your business today.

Sign up

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore

The Best Way to Migrate WordPress Site

With such fierce competition in almost every industry, businesses feel obliged towards providing their users with a premium website experience in order to scale their