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: Connect to Azure CLI

# Set PSGallery as trusted to bypass promptsSet-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted -WarningAction SilentlyContinue #…

PowerShell: Creating VSS Snapshots on Microsoft File Server Clusters

<# VSS-Snapshots-on-Microsoft-File-Server-Clusters_v0.0.1.ps1 # Author: KimConnect.com Functions: 1. Create snapshots of all volumes on a file…

WordPress PHP Fatal error: Maximum execution time of 30 seconds exceeded

Error: [Tue Oct 12 05:57:03.088314 2021] [php7:error] [pid 167] [client 172.16.90.64:39776] PHP Fatal error: Maximum…
Other project: DragonCoin.com