How to Change WordPress Memory Limit

To change the memory limit in WordPress, you can follow the steps below. However, to modify these settings, you might need certain permissions on your hosting account. If you are using shared hosting, you may not be able to change these settings directly, and in that case, it’s recommended to contact your hosting provider.

1. Editing the php.ini File:

  1. Log in to your hosting account and open the file manager.
  2. Locate the php.ini file. If it already exists, you can edit it. If not, you may need to create one.
  3. Add or update the following lines:

    memory_limit = 256M

    This example sets the PHP memory limit to 256 megabytes. You can increase this value according to your needs.

  4. Save the changes and close the file.

2. Editing the wp-config.php File:

  1. Open the wp-config.php file in the main directory of your WordPress installation.
  2. Add the following code at the top of the file:
    define('WP_MEMORY_LIMIT', '256M');
    

    This example sets the WordPress memory limit to 256 megabytes. You can increase this value according to your needs.

  3. Save the changes and close the file.

3. Cpanel (Cloudlinux)

Change cPanel Memory Limit

After following these steps, the memory limit for WordPress should be increased. However, keep in mind that setting this value too high may not be suitable for certain server configurations. Pay attention not to exceed the limits set by your hosting provider.

0 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like