Increasing the WordPress memory limit

WordPress sets a default memory limit for PHP scripts, and WooCommerce may require more memory than this default allows. When your store exceeds the available memory, you may see errors such as “Allowed memory size exhausted” or experience slow performance and failed operations. This guide explains how to increase the WordPress memory limit to resolve these issues.

Check your current memory limit

↑ Back to top

Before making any changes, check your current PHP memory limit and WordPress memory limit to confirm whether an increase is needed.

  1. Go to WooCommerce > Status > System Status in your WordPress dashboard.
  2. Look for the Server environment section. The PHP memory limit row shows the memory your server allocates to PHP.
  3. Look for the WordPress environment section. The WP memory limit row shows the memory WordPress is configured to use.

If either value is below 256 MB, increasing the memory limit may resolve performance issues and errors.

Contact your host

↑ Back to top

The simplest way to increase your memory limit is to contact your hosting provider and ask them to increase the PHP memory limit for your site. Most hosts can make this change quickly on your behalf. This is the recommended approach if you are not comfortable editing server configuration files.

Adjust the memory limit yourself (advanced)

↑ Back to top

If you prefer to make the change yourself, you can increase the WordPress memory limit by editing one of several configuration files on your server. The sections below describe each method.

Note: The methods below require access to your site’s files and familiarity with editing configuration files. Incorrect changes to these files can cause your site to become inaccessible. If you are not comfortable making these changes, contact your host instead.

Edit your wp-config.php file

↑ Back to top

The wp-config.php file controls core WordPress settings, including the memory limit. To increase it:

  1. Open your site’s wp-config.php file using a file manager or FTP client.
  2. Locate the line that says /* That's all, stop editing! Happy publishing. */.
  3. Add the following line above that line:
define('WP_MEMORY_LIMIT', '256M');
  1. Save the file.

This sets the maximum amount of memory WordPress can use to 256 MB.

Note: The WordPress memory limit is separate from your server’s PHP memory limit. You may need to increase both. (descriptive link text describing the destination) about the WordPress memory configuration.

Edit your php.ini file

↑ Back to top

If you have access to your site’s php.ini file, you can increase the server-level PHP memory limit:

  1. Open your site’s php.ini file.
  2. Locate the memory_limit line.
  3. Change its value to 256M:
memory_limit = 256M ; Maximum amount of memory a script may consume (64M)
  1. Save the file.

Edit your .htaccess file

↑ Back to top

If you do not have access to your php.ini file, you can add a directive to your site’s .htaccess file instead:

  1. Open your site’s .htaccess file using a file manager or FTP client.
  2. Add the following line to the file:
php_value memory_limit 256M
  1. Save the file and reload your site to apply the change.

Verify the change

↑ Back to top

After increasing the memory limit, confirm that the new value is active:

  1. Go to WooCommerce > Status > System Status in your WordPress dashboard.
  2. Check the PHP memory limit value in the Server environment section and the WP memory limit value in the WordPress environment section.
  3. Confirm that the values reflect your updated memory limit (for example, 256 MB).

You can also check the Tools > Site Health screen in WordPress for any remaining memory-related warnings. If the memory limit has not changed, your hosting provider may enforce a maximum value that overrides your configuration. In that case, contact your host to request the increase.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.