Change WordPress Memory Limit

One of the problems you might come across in WordPress is the out of memory error. With this you will get a white screen of death error in a live environment. The way you will find out that this error is by checking the wp_debug file where it will tell you that WordPress has ran out of memory, "Allowed memory size of xxxxxx bytes exhausted".

It can be caused by poorly written plugins that will continue to run a procedures until the server runs out of memory.

The default memory allocated to WordPress is 40MB for single site installs and 64MB for multisite installs.

If the value in the php.ini is more than the allocated WordPress amount WordPress will use this value. For example if WordPress has allocated 40MB of memory and php.ini is configured to 64MB then WordPress will use 64MB. You only need to use this setting if you want to increase the amount of memory used by the WordPress site and not by other applications. For example if php.ini is set to 64MB you can change just your WordPress site to use 80MB.

The amount of memory that you set can be changed in the wp-config.php file using a constant WP_MEMORY_LIMIT.

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

You might find that admin tasks require more memory than on the front-end, you're able to change the memory settings used in the admin area by using the constant WP_MAX_MEMORY_LIMIT.

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

To see what other settings you can change in the wp-config file try our wp-config.php generator.

WP-Config Generator

Coveloping Membership

Access to a range of developer tools, get your first month free

Start Your Free Trial

Don't miss out!

Sign up to our newsletter for the latest news from Coveloping

Leave a Reply

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

Code Copied!