11 WordPress ServicesView all
8 industry verticalsAll industries
12 UK locationsAll locations
Home/Blog/Troubleshooting
Troubleshooting11 November 2026· 5 min read

WordPress "Allowed Memory Size Exhausted": How to Fix the PHP Memory Error

WordPress is showing a fatal error about memory size being exhausted. Here is what causes this error, how to increase the PHP memory limit from three different locations, and how to identify which plugin is responsible.

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.

Frequently asked questions

What does "Allowed memory size exhausted" mean in WordPress?+

PHP has a memory limit — a maximum amount of RAM a single script can use. When a WordPress page load, plugin operation or admin task exceeds this limit, PHP stops with a fatal error. The default limit on many shared hosting plans is 32MB or 64MB, which is too low for most modern WordPress setups with multiple active plugins.

How do I increase the PHP memory limit in WordPress?+

Add define('WP_MEMORY_LIMIT', '256M'); to wp-config.php before the line that reads "That's all, stop editing". If your host restricts wp-config.php changes, add php_value memory_limit 256M to .htaccess instead. As a last resort, ask your hosting provider to increase the limit in php.ini directly.

How much PHP memory does WordPress need?+

Most WordPress sites run well at 128MB to 256MB. Sites with WooCommerce, Elementor or multiple active integrations may need 256MB. Sites regularly hitting 512MB or more have a code problem — excessive memory consumption at that level indicates a poorly written plugin, not a genuinely high requirement.

How do I find which plugin is causing the WordPress memory error?+

Enable WP_DEBUG and WP_DEBUG_LOG in wp-config.php. The error log shows the exact file and function that triggered the memory exhaustion — the file path will typically include a plugin name. Alternatively, install Query Monitor — it logs memory usage per request and shows which plugins are consuming the most.

Related service

Persistent memory errors on WordPress often indicate a deeper plugin or server configuration problem. Our maintenance plans include direct developer access to diagnose and permanently resolve these issues.

WordPress Maintenance Plans →

Next article

Troubleshooting

WordPress Stuck in Maintenance Mode: The 30-Second Fix

→
← All articles