WordPress stops loading and shows "Allowed memory size of 67108864 bytes exhausted (tried to allocate X bytes)". That number — 67108864 — is 64 megabytes: the default PHP memory limit on many shared hosting plans. The error means a PHP process tried to use more memory than the server allows. Here is how to fix it.
What the PHP memory limit error actually means
PHP has a configurable memory limit that caps how much RAM a single script can use. WordPress itself uses a small amount, but plugins — particularly page builders, SEO tools, WooCommerce and backup plugins — can consume significant memory during certain operations. When the total exceeds the server limit, PHP terminates the request with a fatal error.
Fix 1: Increase the limit via wp-config.php (recommended)
Open wp-config.php in your WordPress root directory. Find the line that reads "That's all, stop editing! Happy publishing." and add these two lines directly above it:
define('WP_MEMORY_LIMIT', '256M');
define('WP_MAX_MEMORY_LIMIT', '512M');WP_MEMORY_LIMIT sets the memory available for front-end requests. WP_MAX_MEMORY_LIMIT sets the limit for admin operations. Admin tasks — running backups, regenerating thumbnails, importing data — consume more memory than front-end page loads, so both values are worth setting.
Fix 2: Increase via .htaccess if wp-config.php is restricted
If your host restricts PHP settings via wp-config.php, add this line to your .htaccess file:
php_value memory_limit 256M
Fix 3: Identify the plugin consuming the memory
Simply increasing the limit treats the symptom. Install the Query Monitor plugin — it shows memory usage per request and identifies which plugins and functions are consuming the most. A plugin using over 50MB on a standard page load has a code problem. Report it to the developer with your PHP version, WordPress version and Query Monitor output.
ImportantMost shared hosting plans cap PHP memory at 256MB regardless of what you set in wp-config.php. If you need more than 256MB, you will need a VPS or cloud hosting plan where PHP is configurable directly. If your site consistently requires over 256MB for normal operation, it is a sign of problematic plugins rather than a hosting limitation to work around.