How to Resolve the WordPress Memory Limit Error | GreggHosting

The affects of Web Hosts on Your Business Website

Here're ways your choice of web hosting service provider impacts the performance of your business:


check

Website loading speed

check

Uptime and availability

check

Customer support

check

Security

check

Server location

How to Resolve the WordPress Memory Limit Error (2 Methods)?

How to Resolve the WordPress Memory Limit Error (2 Methods)?

Wordpress Care Plans

Overview

Using an open-source platform like WordPress has both benefits and cons. It’s adaptable and infinitely scalable, but it does necessitate a certain level of technical proficiency. This is especially important when diagnosing and resolving some of the most common mistakes that occur when utilizing the platform. Now learn How to Resolve the WordPress Memory Limit Error (2 Methods) from this Blog

On rare occasions, you’ll receive an error message stating that your site’s ‘PHP memory limit’ has been reached. This can be perplexing at first, especially if you don’t know what’s causing the issue or how to remedy it. Fortunately, this is one of the easiest problems to fix, and even inexperienced WordPress users should be able to do so.

We’ll explain what a WordPress memory limit problem is, why it might occur on your WordPress site, and then walk you through some of the solutions for repairing it in this knowledge base article.

Let’s get started!
Contents Table of Contents

WordPress Memory Limit Errors: An Overview

Why Is Your WordPress Site Showing a Memory Limit Error?
The WordPress Memory Limit Error and How to Fix It (2 Methods)
WordPress Memory Limit Errors: An Overview
Although WordPress is a fairly solid platform, it is not without flaws. You may encounter a variety of troubles, including the iconic ‘White Screen of Death’ or a site that is locked in maintenance mode.’

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.

This leads us to one of the most commonly encountered issues: the WordPress memory limit error. This is also known as a ‘PHP memory limit error,’ and it appears as follows:

fatal flaw: The maximum memory size of 67108864 bytes has been reached.

The error can arise under a variety of circumstances. However, it is most likely to occur when you perform specific actions on your website, such as:

Adding a new theme or plugin to your site and activating it.
Adding photos and other types of media to your website.
Don’t panic if you’ve seen this problem on your own WordPress site. The reasons behind this are straightforward – let’s take a closer look at why it happens.

The PHP memory limit error hits you in the face once you refresh a page. Here are all the things you should look into in order to solve it.

Why Are You Getting a WordPress Memory Limit Error on Your Site? CLICK TO TWEET

The name itself contains the key to the source of the’memory limit’ problem. Your website, like everything else, requires a certain amount of RAM to store all of its data. This includes the database and files, as well as all of your content, plugin and theme code, and more.

Your hosting server provides this memory. When you buy a hosting package, you get a certain amount of resources, including memory, which is utilized to store your site and make it run smoothly for visitors.

Naturally, selecting a higher-tier hosting package gives your website additional space and memory. Many new website owners begin with basic shared hosting services, which isn’t always a bad thing. However, this means that your allocated memory will be limited.

You may eventually reach your RAM limit if your site grows larger or you begin to use more complicated plugins and scripts.

In the case of WordPress, this means you’ll get a PHP memory limit error and won’t be able to execute the activity you were attempting.

How to Determine Your PHP Memory Limit
If your site is using WordPress 5.2 or higher, you can utilize the Site Health tool to see what your PHP memory limit is. Go to “Tools” “Site Health” “Info” on your WordPress dashboard and scroll down to the server section. You may see that your server has a PHP memory limit.

Examine the PHP memory limit.
If the quantity is small, such as 32M, there is just one solution: increase the amount of memory assigned to your site. There are, however, a few distinct approaches to this.

How to Resolve the WordPress Memory Limit Error (2 Methods)

Unlike many other common issues, the WordPress memory limit problem is easy to fix. You won’t have to go through a lot of trial and error to figure out how to solve it because it has a very clear reason.

Instead, when your website’s PHP memory limit is reached, there are just two options. You have the option of increasing the amount of memory assigned to your site or upgrading to a hosting plan with additional space. Let’s look at when and how you might want to employ each of these approaches.

Option 1: Increase Your Website’s PHP Memory Allocated
Option 2: Upgrade the hosting plan for your website.
Option 1: Increase Your Website’s PHP Memory Allocated
It may appear straightforward, but the most obvious answer is not always the best. If your website has run out of memory, the simplest solution is to increase the amount of memory available to it.

Obviously, the extent to which you can extend the limit is determined by your hosting provider and package. In the next section, we’ll go over this topic in further detail. However, it’s not uncommon for your website to be consuming less RAM than it has.

The current memory limit for your site is set in the wp-config.php file, and it may or may not correspond to the limit established by your provider. As a result, the first step is to try to increase your PHP memory limit by modifying the file.

Do you want to discover how we grew our traffic by over 1000%?
Join the 20,000+ people who receive our weekly email with WordPress insider secrets!

Now is the time to subscribe.
Accessing Your Site’s Files with an FTP Client
To increase your site’s memory limit, you’ll need to log in directly and use Secure File Transfer Protocol (SFTP). If this is your first time, you’ll need to download and install an SFTP client, which is a program that allows you to connect to your site’s files on its server.

FileZilla is a free and reasonably simple to use file manager that we recommend:

FileZilla \sFileZilla
After that, you can use this instruction to set up FileZilla and build a connection with it. You’ll need the SFTP credentials for your site, which can normally be found in your hosting account. If you have any issues, you should be able to contact your provider, who will be able to inform you where to look for your credentials.

Where Can You Find Your wp-config.php File?
Once FileZilla is installed and linked, you should see something like this:

FileZilla was able to establish a connection.
A list of the folders that hold your site’s files may be found in the top-right quadrant. Look for your site’s ‘root’ folder, which is usually called public html or www and is named after your site’s domain. Look within this folder for a file called wp-config.php:

WordPress’s wp-config.php file
This file contains information about the database and settings of your website. As a result, it’s critical to avoid changing anything other than the line of code we’ll be looking at. In fact, making a backup of your site before going is an excellent idea, just in case you delete or change something vital by accident.

Raising the Memory Limit on Your Site
Open up your wp-config.php file now that you’ve made a backup. This is what it should look like:

Have you had enough of WordPress memory limit errors? This will not be an issue at GreggHosting. Examine our hosting options.

The wp-config.php file is an example of a configuration file.
Then check for the following line in the file:

define(‘WP MEMORY LIMIT’, ‘256M’); define(‘WP MEMORY LIMIT’, ‘256M’); define(‘WP ME

The number in your file may be different, as it represents your site’s current memory limit. It’s also possible that you won’t come across this line at all.

If you find the line, increase the number of characters it contains. In the vast majority of circumstances, 256 MB should plenty. If you can’t find the line, copy it and paste it exactly before the line that says, “That’s all, stop editing!” “Enjoy your blogging.”

Then quit FileZilla and save the modifications to your wp-config.php file. Reopen your site and do the same activity you did when the WordPress memory limit error first appeared. You’ve solved the problem if it no longer appears.

If the error persists, try opening your wp-config.php file and increasing the memory limit even further. If you attempt this a few times and it doesn’t work, it’s possible that you’ve reached your hosting provider’s maximum limit. You’ll need to take a different method in this scenario.

Before we go any further, it’s worth noting that certain hosts will not allow you to access your site via an FTP client. In this case, you can usually increase your memory limit manually using alternative methods, such as cPanel. Check out this knowledge base page for more information on your other possibilities.

Option 2: Upgrade the hosting plan for your website.
Each sort of hosting comes with its own set of resources. However, with time, those resources may become insufficient for your website.

If you haven’t been able to increase your site’s memory limit using the methods discussed above, the first step is to determine how much memory your current hosting plan allows. This information may be available on your provider’s website or in your hosting dashboard. Otherwise, you should be able to find out by contacting your provider directly.

If your site’s maximum memory limit has been reached yet you’re still getting the WordPress memory limit issue, your only practical solution is to switch hosting providers. Switching carriers, upgrading to a higher tier, or choosing a different type of plan are all options.

It may be time to move from a shared hosting plan to a Virtual Private Server (VPS) or cloud hosting, both of which provide additional space and resources. It’s also a good idea to seek for a flexible plan that allows you to simply raise the quantity of resources assigned to your site as needed.

We provide managed WordPress hosting with GreggHosting, which is powered by the Google Cloud Platform:

GreggHosting has big plans.
Not only is it quick and safe, but it also has a default memory limit of 256 MB on all of our plans. This should suffice for the vast majority of websites. If you have any memory-related issues on GreggHosting, please contact our support staff and we’ll assist you in resolving the issue.

We even provide free migrations from a variety of other WordPress hosting providers. This means you may rapidly migrate your site to a new location and get rid of the WordPress memory limit problem.

Summary

It’s aggravating to come across an issue 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.

When it comes to dealing with a PHP memory limit issue, you have two major options:

Using an SFTP client or a comparable tool, manually increase your site’s RAM limit.
Upgrade your hosting plan to one that provides additional resources for your website.
If you have any additional concerns about how to resolve this mistake or would want to learn more about our free migrations, please contact our Customer Support team, and they will be pleased to assist you!

Save time, and money, and improve site performance by using:

Expert WordPress hosting assistance is available 24 hours a day, 7 days a week.
Integration with Cloudflare Enterprise.
With 29 data centers across the world, we can reach a global audience.
With our built-in Application Performance Monitoring, you can improve your performance.
All of this and more is included in a single plan that includes no long-term obligations, aided migrations, and a 30-day money-back guarantee. Check out our plans or speak with a sales representative to find the ideal plan for you.