How to Increase the PHP Memory Limit in WordPress Site?

Increase the PHP memory limit
Increase the PHP memory limit in WordPress Site

In this article, I will discuss, how you can increase the PHP memory limit. You can do it in few simple steps. There are multiple ways to change the memory limit but here I will discuss only one method.

WordPress is a very popular and most preferred content management system. To run every website on WordPress, you need to have a PHP memory. You use plugins, themes, images, and other content on your site. And all these require memory to run.

Advertisement

At some point, you may exhaust your PHP memory limit and you may face a memory limit error. It most common error in WordPress sites. And it will depend on how much memory you have and how much you have used.

If you have exhausted your memory, you may face an error. And in that case, you need to increase the PHP memory limit.

Let’s understand how you can do it.

Increase the PHP Memory Limit

First, you should know what is your current memory limit of your website. You can check it from the Cpanel and as well as Site Health also.

What is Site Health in WordPress? Check Health Status & Info

How to Check PHP memory Limit from WordPress Dashboard?

As I above said that there are multiple ways to increase the PHP memory limit of your website. However, here I will discus, how you can change it through wp-config.php. You can do it in the following steps.

  • First of all, you log in to your Cpanel.
  • Open the File Manager.
  • Do double click on the Public.html file.
  • Select wp-config.php file by doing single click.
  • Do the write click and click on edit.
  • Now find a code like in the below image.
PHP memory limit
Memory limit

You may have another number instead of 256M. Now you can set the figure as per your choice. However, you can do it up to the maximum memory limit allocated to you by your host.

Increase the PHP memory limit in the wp-config.php file and save your file. If your site is brand new, you might not have the same code in your file. So in that case, you can add the above code.

But before you start the process to change the limit, you should always take the backup of your site. So, In case, something goes wrong, you can restore your site.

In this way, you can increase your PHP memory limit in your WordPress site. In case, this method doesn’t work for you, you may try another suitable method for you. But in case you face this error after that also, you should contact your host provider.

Read More:

How to Add PDF File in WordPress? Quick & Easy Process

How to Add Private Post in WordPress?

Advertisement