Posted On October 11, 2021

How To Increase WordPress Memory Limit

kimconnect 0 comments
blog.KimConnect.com >> Codes >> How To Increase WordPress Memory Limit

It’s are lesser known fact that WordPress overrides PHP’s memory_limit settings. Thus, it is possible to edit the wp-config.php file to increase WordPress’ memory allocation.

Depending on the deployment configs, wp-config.php usually is located in the /public/html directory. In the case of docker, it’s one level above wp-content directory.

A. Increasing the Administrative Memory

For admin pages, WordPress ignores PHP’s memory limit and configures its own. To change it to something other than 256 megabytes, you must set WP_MAX_MEMORY_LIMIT in wp-config.php.

To increase the memory to the administrative side of your site, add the following line in your wp-config.php:

// This sets the admin panel memory limit to 4GB
define('WP_MAX_MEMORY_LIMIT', '4G');

B. Increasing Public Memory

To increase the memory limit for your public-facing pages, open your app’s wp‑config.php and add the following line:

// This configures the public users' view memory limit to 8GB
define('WP_MEMORY_LIMIT', '8G');

Leave a Reply

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

Related Post

PowerShell: Check IP Conflicts of Computers in Active Directory

We have ran into issues where a group of virtual machines living on a DHCP…

PowerShell: Maintain Linux Services via SSH Remoting

Version 2: # maintainLinuxServices.ps1 # Version 0.0.2 # Description: this is a simple script to…

PowerShell: Adding Active Directory Module

Windows environments often are controlled by Active Directory; hence, it is useful to include this…