How to Increase WordPress Memory Limit

Increasing the memory limit in WordPress can help improve performance, especially for resource-intensive plugins and themes. Follow these steps to increase the memory limit:

Step 1: Log into cPanel

  1. Log into your cPanel from within your Clouduxe client account.

Step 2: Access File Manager

  1. Locate and click the "File Manager" menu in the Files section.

  2. Click on the public_html folder.

Step 3: Edit wp-config.php

  1. Search for the wp-config.php file, right-click on it, and select "Edit."

The wp-config.php file is crucial for your WordPress installation, so be careful when editing it.

Step 4: Add Memory Limit Code

  1. Add the following code right before the line that says: // That's all, stop editing! Happy blogging.

    define( 'WP_MEMORY_LIMIT', '512M' );
  2. You can enter any value where 512M is stated, depending on your needs and server capabilities.

Alternative Method: Modify default-constants.php

If necessary, you can also change the memory limit in the wp-includes folder by editing the default-constants.php file. However, this method is less common.

Step 5: Confirm Changes

To confirm that your changes have taken effect, create a phpinfo.php file. Here’s how:

  1. In the File Manager, create a new file named info.php.

  2. Add the following code to the file:

    <?php phpinfo(); ?>
  3. Save the file and navigate to yourdomain.com/info.php in your browser.

Conclusion

Increasing the WordPress memory limit can enhance your site's performance and stability. Always remember to back up your site before making changes to configuration files.

Setting an excessively high memory limit can lead to server issues. Always check your hosting provider's recommended limits.

Last updated

Was this helpful?