Increase WordPress Memory Limit

Increase WordPress Memory Limit

Sometimes a WordPress site needs more memory due to a variety of reasons, but if you are getting:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes)

You may want to increase your PHP memory limit to get your site running smoothly again and then revisit your plugin and theme choices to see if you can reduce the amount of memory needed.

To increase the memory try these two methods together:


In your php.ini file change this line:

memory_limit = 64M ;

If your line shows 32M try 64M. If your line shows 64M try 128M

If you do not have access to a php.ini file then try that file to the root directory where the wp-config.php file is located and add the memory limit line.

For further help increasing it, your hosting service is the best place to start.

In your wp-config.php file add the constant WP_MEMORY_LIMIT.

define('WP_MEMORY_LIMIT', '80M');

If most of the memory issues are in the admin you can consider increasing it there with this constant WP_MAX_MEMORY_LIMIT.

define('WP_MAX_MEMORY_LIMIT', '128M');

Make sure to add those above this line:

/* That's all, stop editing! Happy blogging. */

Looking for more help on debugging? Check out WordPress Codex.