What this problem looks like
WordPress default memory is often 40M, which is tight for WooCommerce and builders. WP_MEMORY_LIMIT asks PHP for more per request.
Raising memory treats the symptom. Bloated plugins or runaway queries still need investigation on busy sites.
Step 1: Set memory in wp-config.php
Open wp-config.php in your site root, next to wp-admin and wp-content. Search for WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT first. If those lines already exist, update them instead of adding duplicates. If neither exists, paste the constants above the line that says stop editing:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' ); Step 2: Change PHP memory_limit in hosting
cPanel MultiPHP INI Editor and Plesk PHP settings control the server ceiling. WordPress cannot exceed memory_limit in php.ini.
- Set
memory_limitto 256M or 512M for builder sites. - Restart PHP-FPM if the host requires it after INI changes.
Step 3: Verify current limits on SSH
Only run these commands if you have SSH access to the server.
wp eval 'echo WP_MEMORY_LIMIT . "\n";'
php -i | grep memory_limit Step 4: When raising memory does not help
Infinite loops and broken queries still exhaust any limit. Enable WP_DEBUG_LOG in wp-config.php and profile heavy plugins. Search for existing WP_DEBUG lines first and update them instead of adding duplicates.
Rename wp-content/plugins to plugins.disabled via File Manager, SFTP, or FTP to isolate a plugin that leaks memory.
Step 5: WooCommerce and import guidance
Product CSV imports and translation plugins often need 512M temporarily. Lower limits after the job completes if the host prefers it.
When to stop DIY and hire help
Chronic memory errors on production shops need code-level fixes, not only INI tweaks. BugShield diagnoses memory and performance issues at a confirmed fixed price.