brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT raise the wordpress PHP memory

WordPress
~/tips/tip-wordpress-memory-limit-constants

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

Sets how much PHP memory WordPress asks for, one value for the front end and one for the admin.

The error that says allowed memory size was exhausted has a quick fix in wp-config.php.

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

WP_MEMORY_LIMIT is the limit WordPress tries to set for normal requests (40M by default, 64M on multisite), and WP_MAX_MEMORY_LIMIT is the higher limit it uses in the admin area for heavy jobs. WordPress raises the limit with ini_set, so it does nothing when the host or the PHP-FPM pool has a hard cap in memory_limit. Check the real value under Tools, Site Health, Info, Server. A plugin that needs gigabytes has a bug, so do not just keep raising the number.

Further reading: WordPress: Editing wp-config.php

More WordPress tips wp user application-password create anna backup-script --porcelain define( 'MEDIA_TRASH', true ); wp cli check-update wp theme delete --all wp media image-size All WordPress tips (85) All topics

Link