How to change WordPress memory limit

WordPress sets the PHP memory limit to 40MB by default, which means that a single PHP script can use up to 40MB of RAM. If you need more memory to run heavier plugins, you must increase the default memory limit. This article will show you how to increase WordPress's memory limits.

View WordPress memory information

To view the WordPress memory limit, follow these steps:

  1. Log in to your WordPress site with an administrator account.
  2. On the Dashboard in the left sidebar, click Tools, and then click Site Health:

  3. Click on the Info tab, and then click WordPress Constants:

  4. The WordPress memory settings are listed WordPress Constants:

How to modify WordPress memory limit

To increase WordPress memory limit, follow these steps:

  1. Login to cPanel, and then click on File Manager:

  2. On the File Manager, search for wp-config.php, and then click Go:

  3. Right click on wp-config.php, and then click Edit to edit the wp-config. php file:

  4. Search for the following lines in wp-config.php to change the memory allocation:

     define( 'WP_MEMORY_LIMIT', '40M' );
  5. Change the memory from 40MB to either 64MB or 128MB. (if these lines are not available, move to the next step).
  6. Add the following lines in the wp-config. php file right above “That's all, stop editing! Happy publishing”:

    define( 'WP_MEMORY_LIMIT', '64M' );
    define( 'WP_MAX_MEMORY_LIMIT', '256M' ); 
    
  7. Click on Save Changes to change the WP memory limits:

  8. On the WP admin dashboard , in the left sidebar, click Tools, and then click Site Health. On the info tab, click on WordPress Constants to view the memory limit changes

Article Details

Other Articles in This Category

Show More

Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.

We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.