Fix WordPress Memory Limit Exhausted Error

Published April 21, 2026

Fix WordPress Memory Limit Exhausted Error

The error "Allowed memory size of X bytes exhausted" means PHP ran out of memory executing a request. WordPress needs enough memory to load its core, your active plugins, and your theme simultaneously.

Default Memory Limits

WordPress sets a default memory limit of 40MB, which is insufficient for most modern sites. The recommended minimum is 128MB; sites with many plugins or heavy page builders may need 256MB or more.

Fix 1: wp-config.php (Recommended)

Add before the "That's all, stop editing!" line:

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

WP_MAX_MEMORY_LIMIT applies to WP-CLI and admin processes that need more memory.

Fix 2: .htaccess

php_value memory_limit 256M

Fix 3: php.ini

If you have access to php.ini:

memory_limit = 256M

Diagnosing Which Plugin Uses the Most Memory

Install Query Monitor to see per-request memory usage broken down by component. Page builders, WooCommerce with many extensions, and image processing plugins are the most common heavy consumers.

Long-Term Solutions

SiteICO plans are configured with PHP memory limits appropriate for each tier, with easy upgrades when your site grows.