How to Increase WordPress Memory Limit in Quick Steps?

increase-wordpress-memory-limit

Introduction 

You must have come across so many errors on your WordPress website. One of them is the most common: that your memory limit has been exhausted. This is the most common error that users face on their websites. 

WordPress being one of the most reliable platforms is a door to limitless plugins and themes and whatnot. Even the software components and file formats are accompanied by the website you use. While using the website, certain resources require too much memory usage, and unfortunately, the memory limit is exceeded. An exhausted memory message is received when your almost-memory is used. 

To help you with that, we have encountered some quick fixes for your WordPress website. All the fixes are there to help you increase the memory limit on your website. 

How to Increase WordPress Memory Limit? 

So, here we are to let you know how you can pull out the best ways to increase the WordPress memory limit. 

We share the four most applicable methods to increase the WordPress memory limit. But note that not every method will work, as it depends on your hosting environment. There is a higher possibility that at least one method should work; this is why all four methods are being shared.

If you're facing persistent memory issues, investing in a high-quality WordPress theme can significantly improve performance. Premium WordPress themes like those offered by VW Themes are meticulously optimized to handle resource-intensive tasks efficiently, reducing the likelihood of encountering memory limitations.

Some of the methods require core file editing, so it is highly advised to take a complete backup of your website. Let’s get initiated: 

1. Edit the wp-config.php File: 

You are getting a low memory status and need to increase WordPress memory limit as soon as possible, right? WordPress makes this possible by letting you edit the current memory limit in its wp-config.php file using the wp_memory_limit variable. 

Since we are going to edit the wp-config.php file and make changes to the core level, it is needed to take a backup of your site. 

So, to edit the wp-config.php file, you need to connect to the server via file transfer protocol using an FTP client such as FileZilla. 

Under the FileZilla application, reach the Site Manager under the files section. In case you are using this application for the first time, select the New Site option under the Site Manager.

You need to now enter the useful information related to your website, such as the username and the password. This will connect Filezilla to your site by displaying all the files. 

Here, you need to access the root folder. Under the root folder, you need to right-click on the wp-config.php file and select View/Edit. This will open wp-config.php in the default text editor. There, you need to search for the phrase: WP_MEMORY_LIMIT. 

You will find the entire line like this: 

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

Mostly, this line of code is already present in the file, and you need to increase the number of memory limits from 32M to 256M. 

In case this line of code is not present in the file, then you need to manually add this line above this line of code: 

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

2. Change the Server Settings Via PHP.ini. 

There is another method through which you can increase WordPress memory limit by editing the PHP.ini file. This is the file that sets the default configuration of any application that requires PHP. 

When any visitor reaches your website, PHP runs on the server. While the process is being run, the PHP programming language is followed by the PHP.ini for instructions. This function also includes setting the current WordPress memory limit. 

You are highly privileged if you are using a host that uses cPanel. These types of hosts use tools like MultiPHP Manager, MultiPHP INI Editor, or the PHP config. Not all hosts use cPanel, but if your host uses it, then you can edit the PHP.ini configuration easily. 

Hosting services like Bluehost have this ability in their configuration, and they use cPanel. It will give a tool called MultiPHP INI Editor in the full cPanel dashboard. 

Once the tool is opened, its memory limit can be easily adjusted. 

In case your host does not support the in-dashboard PHP.ini editor, you can even edit the PHP.ini file using an FTP client such as FileZilla. 

  • Once you have connected the FTP client, you need to then reach the root directory in the FileZilla window and find the PHP.ini file. 
  • Once the PHP.ini file is found, locate the line that has a “memory limit." From there, you can increase the memory limit and save the changes. 
  • And before the changes come live, you need to restart your server. After your server is back after the restart, you will see the increase WordPress memory limit

3. Edit the.htaccess File:

Then next comes another file type that controls almost every part of your website, including the memory limit. The.htaccess file is an important configuration file type if your hosting service uses Apache. 

The.htacess is the way to relay instructions to the server without editing the server configuration files. This seems the best alternative if you can’t use the PHP.ini file. 

So to access the.htaccess file, you need to connect to the FTP client. Then you need to navigate to your website’s public_html file having the.htaccess file. 

You must add the code below the #END WordPress line by opening this file. 

php_value memory_limit  256M

After this, save changes to the file. 

4. Upgrade Your Website’s Hosting Plan 

This is the fourth method that you can use when all the above methods fail. This is the method where you need to rely on the hosting plan you have chosen. After all, the memory limit is controlled by the hosting plan even if you increase it. The plan you have chosen for your website comes with a finite amount of memory sources. It happens that after putting all the considerations in place, the error still occurs, and you have your hosting plan outraged. 

You can watch out for the memory allocation; you need to visit the web host’s website. Or simply, you can contact your hosting provider for this. This also means you need to upgrade your hosting plan to a better tier with a increase WordPress memory limit. You can even switch to a new hosting service either. 

When looking for a new hosting service, you must watch out for the service that comes with a sufficient amount of memory for each plan. If possible, look for a hosting plan with a memory limit of 256 MB or more. 

To avoid such problems and enhance overall website speed, consider investing in a high-quality WordPress theme bundle. Options like the VW Themes bundle offer a vast collection of themes designed for efficiency and performance, potentially reducing the need for excessive memory allocation.

Why Does the Memory Limit Error occur? 

WordPress is the most reliable and fast-moving platform but never perfect. There can be errors that may hurt the functionality but also help boost reliability. 

When an error occurs, the user looks at how to resolve it as soon as possible. Well, this is obvious, and with WordPress, it can be easily solved. 

Working with WordPress requires everything to be installed and stored on the server. And when you purchase a web host, the provider allocates some resources to your website. 

Sometimes when uploading any media file, you may come across the fatal error of exceeded memory limit. The same thing happens when you install a new theme or plugin on your website. In such cases, you need to look up the above fixes that will help you recover from increase WordPress memory limit error. 

Conclusion 

We have covered the most common WordPress error solving measures. Memory usage error is one of the most common crises that any website faces. 

At this time, you don’t need to panic but find ways to resolve the error. As we have mentioned, there are so many ways through which you can maximize the memory of your website. We have mentioned them along with the section where you will know how this error enters your website. There are methods where you need expert advice or some developer skills and you need to code to the core. Also, it requires you to keep a complete backup of your website. As some methods require higher code editing. It almost depends on the hosting service you brought for your website. This event gives an idea to pick out a hosting service and plan with maximum memory usage.

Back to blog