Home / WordPress / Allowed Memory Size Exhausted in WordPress: Fix

Allowed Memory Size Exhausted in WordPress: Fix

Fix PHP memory exhaustion errors in WordPress by increasing memory limits and reducing heavy plugins/queries.

Views: 20 Unique: 16 Updated: 2026-03-18

What this problem is

WordPress displays: Allowed memory size exhausted and a page fails to load.

Why it happens

  • PHP memory_limit is too low for your workload
  • Plugin/theme performs heavy operations
  • Large autoloaded options or heavy queries

Prerequisites

  • Access to hosting PHP settings and wp-config.php

Diagnosis

Check the error log line to identify the script/plugin and the memory limit value.

Detailed steps

Step 1) Increase PHP memory_limit

In hosting panel, raise memory_limit (example: 256M or 512M depending on the site).

Step 2) Increase WordPress memory (wp-config.php)

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

Step 3) Reduce memory usage

  • Disable heavy plugins temporarily and retest
  • Optimize images and page builder usage
  • Clean large autoloaded options if needed

Expected results

  • Pages load without memory exhaustion

What to do if it fails

  • Ask hosting for real memory usage and whether the account hits process limits; consider upgrading plan

Best practices

  • Monitor memory after updates and avoid plugins that continuously spike usage
Back to category