How to Increase the Maximum Memory Limit

Sometime you may encounter a blank page, endless saving or get a PHP Fatal error regarding the Allowed memory size of xxxxxxx bytes exhausted. This is one of the most common WordPress errors and it’s easily fixable by increasing the PHP memory limits.

The best solution for this error is to ask your hosting provider for help. In case you want to try to fix this error on your own, you can follow one of the solutions below.

Raise the WordPress memory limit by editing wp-config.php file

  1. Open wp-config.php, by default, located in the WordPress site’s root directory.  You can use FTP or File Manager on your hosting to access the file.
  2. Find the line at the end of the file that says: That’s all, stop editing! Happy blogging.
  3. Add following code:
define('WP_MEMORY_LIMIT', '256M');

This code tells WordPress to increase the PHP memory limit to 256MB.

WordPress memory limit can be different from the limit on the server side – you need to set WordPress memory limit regardless of server memory settings.

Raise the Server memory limit by editing php.ini file

If you have access to the php.ini file, find the line of code where the memory limit is allocated and raise the value, let’s say to 256MB. It will look like this:

memory_limit = 256M;

Alternatively, in case you do not have access to php.ini file, you may try to increase memory limit by editing .htaccess file by adding the following code:

php_value memory_limit 256M
Was this article helpful?
0 out of 0 found this helpful

We're always happy to help with any questions you might have!
Ask the Community or open a support ticket and our team will reply with a solution.