wp-config.php » WP_MEMORY_LIMIT vs WP_MAX_MEMORY_LIMIT

WP_MEMORY_LIMIT vs WP_MAX_MEMORY_LIMIT

In short: WP_MEMORY_LIMIT is the default limit set for the front end, but it can be raised up to WP_MAX_MEMORY_LIMIT in wp-admin pages.


WP_MEMORY_LIMIT

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

WP_MEMORY_LIMIT allows you to specify the maximum amount of memory that can be consumed by PHP. This setting may be necessary in the event you receive a message such as “Allowed memory size of X bytes exhausted”.

WP_MAX_MEMORY_LIMIT

define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M');

Administration tasks require much more memory than a usual operation so for the wp-admin area, the memory can be increased or decreased by defining WP_MAX_MEMORY_LIMIT.


If not defined, WordPress will attempt to increase the memory allocated to PHP as defined in /wp-includes/default-constants.php to 40 MB (single site) and 64 MB (multisite).

To have no memory limit, set the directive to -1. Check the PHP page for more information.

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended