Skip to content
SazM Senior dev · Fixed price
Find a service
Where can I help?

Use arrow keys to browse, Enter to open, and Escape to close.

11 destinations

Client Login Get a fix →

Bug Fixing · 5 min read

WordPress "Allowed memory size exhausted": Affordable $99 Fix

Fix WordPress "Fatal error: Allowed memory size exhausted": read the real PHP limit, set WP_MEMORY_LIMIT, find the leaking plugin or query, with a $99 fixed-price option.

Summary

"Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes)" means a PHP process on your WordPress site hit its memory ceiling and was killed. You see it as a white screen, a "There has been a critical error on this website" message, a half-loaded admin, a failed plugin update, a stuck import or a checkout that dies at the last step. The byte number in the message is your current limit: 41943040 is 40M, 67108864 is 64M, 134217728 is 128M and 268435456 is 256M.

This guide gives you the fast isolation steps first. If you would rather hand it over, SazM offers an affordable, low-cost WordPress memory exhausted fix for a fixed $99 price, delivered within 48 hours, entirely in writing: no calls, no project manager, one senior developer.

Where the Error Lives

The message names the file and line that was running when memory ran out. That is the first clue, but not always the culprit: it is only the code that asked for the last few bytes. Check these places:

wp-content/debug.log              # when WP_DEBUG_LOG is on
/var/log/php-fpm/error.log        # path varies by host
/var/log/apache2/error.log        # or /var/log/nginx/error.log
wp-config.php                     # WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT
php.ini or .user.ini              # memory_limit

A typical line looks like this:

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 65536 bytes) in /wp-content/plugins/example/includes/class-export.php on line 212

Note whether it happens on one page, in wp-admin only, during a cron run or during an import. Each points to a different cause.

Quick Fix Breakdown (DIY)

  • Read the limit PHP really uses. WordPress and PHP each have a setting, and the host can override both:
wp --info                       # shows the PHP binary and ini files
php -i | grep -E "memory_limit|Loaded Configuration"
wp eval 'echo ini_get("memory_limit");'

The CLI value can differ from the web value, so also create a temporary page that prints ini_get('memory_limit') through the web server, then delete it.

  • Raise the limit to a sensible value, not a huge one. In wp-config.php, above the line that says "That's all, stop editing":
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' ); // wp-admin and heavy tasks only

WP_MEMORY_LIMIT cannot exceed what PHP allows. If the value does not change, set memory_limit = 256M in php.ini or .user.ini, or in your hosting panel's PHP settings, then restart PHP-FPM or wait for the .user.ini cache to refresh. On Apache with mod_php only, php_value memory_limit 256M works in .htaccess; on PHP-FPM that line causes a 500 error.

  • Find what is eating memory instead of only raising the cap. Turn on logging without showing errors to visitors:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
  • Isolate the plugin or theme. On a staging copy, deactivate everything and switch on one at a time:
wp plugin list --status=active
wp plugin deactivate --all
wp theme activate twentytwentyfour   # any default theme you have installed
  • Check the usual heavy hitters: page builders with large templates, backup and security scanners running on web requests, image optimisers, WooCommerce reports, broken cron loops and big imports. Run imports and bulk jobs through WP-CLI, which has no web timeout, instead of the browser.
  • Look at the database, not only PHP. Huge autoloaded options slow and bloat every request:
wp db query "SELECT SUM(LENGTH(option_value)) AS bytes FROM wp_options WHERE autoload='yes';"

Use your own table prefix. Several megabytes of autoloaded data is a red flag.

  • Memory leaks do not cure themselves. If raising the limit only delays the crash from 128M to 256M to 512M, a plugin is looping or loading an unbounded query. Raising the cap again just moves the failure and can exhaust the whole server.

If none of these isolates it within an hour, stop. Every extra hour is lost orders and lost search ranking.

Hand It Over: $99 Fixed, Within 48 Hours

Memory errors drag on because the cause is split three ways: the host's real limit, the code that asks for too much, and the data it loads. One developer who checks all three ends the guessing.

What you get for $99:

  • A fixed price agreed before work starts. One issue, one flat fee, no hourly meter.
  • Delivery within 48 hours of access, with the fix verified on staging before anything touches production.
  • Fully written, fully async. You send the URL, the page or action that fails, the exact error line and what changed recently (plugin update, PHP upgrade, new host, import). You get questions, progress and proof in writing. There are no calls, meetings or project managers.
  • Written proof it works: the root cause in plain language, which plugin, setting or query was responsible, a before and after check, and a rollback note.
  • Money-back guarantee if the agreed root cause cannot be resolved.
  • Safe access only: a limited SSH, hosting or WordPress admin account that you can revoke. Never send passwords through the inquiry form.

If the site shows a full white screen after an update, see WordPress crash recovery after a plugin update. If the problem is slow pages rather than a fatal error, see Core Web Vitals, INP and LCP remediation.

Behind it: 20+ years in production (since Oct 2006) and 100+ projects in the portfolio.

Get this error fixed for $99 → · Queue an urgent fix · See past projects

Frequently Asked Questions

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

A PHP process tried to use more memory than its configured limit and was stopped. The number in the message is the limit in bytes, for example 268435456 bytes is 256M. The file named in the message is where PHP ran out, not necessarily the plugin that caused it.

How do I increase the WordPress memory limit?

Set WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT in wp-config.php, and raise memory_limit in php.ini, .user.ini or your hosting panel. WordPress cannot go above what PHP allows, and some hosts cap it regardless of your settings.

Is raising the memory limit a real fix?

Only when the site genuinely needs more memory, such as a large import or a big WooCommerce catalogue. If the error returns after each increase, a plugin or query is leaking or looping, and the root cause needs fixing.

Why does the error appear only in wp-admin or during an import?

Admin screens and bulk jobs load far more data than front-end pages and use the higher WP_MAX_MEMORY_LIMIT. Heavy plugins, large media libraries and big imports hit the ceiling there first. Running the job through WP-CLI often avoids it.

How much does it cost to fix a WordPress memory exhausted error?

SazM fixes one issue for a fixed $99, delivered within 48 hours, with a money-back guarantee if the agreed root cause cannot be resolved. Typical agency hourly rates are higher and open-ended, while very low marketplace gig prices rarely include root-cause diagnosis, a staging test or a guarantee.

// SazM ENGINEERING DISPATCH · PRODUCTION REMEDIATION

Senior Engineering Without Agency Overhead

// TRACK A · FIXED-PRICE FIXES (48H SLA)

Single Urgent or Speed Fix

Immediate code-level fixes with zero discovery calls. Emergency root-cause patch within 48 hours for $99, or full Core Web Vitals & speed remediation with before/after audit for $199. 100% money back if the agreed root cause cannot be fixed.

Running WordPress or WooCommerce? The WordPress care plan keeps your site updated, hardened, backed up daily, and monitored for $49/mo.

// TRACK B · SENIOR RETAINER & BUILDS

Monthly Plan or Custom Scope

Direct senior-level capacity embedded in your stack. Dedicated monthly engineering ($999/mo, 1 active task at a time, 24–48h PR delivery, pause or cancel anytime), or fixed-scope architectural milestones delivered within a 24h written quote.

✓ 20+ years engineering ✓ 100+ projects in the portfolio ✓ Fixes within 48 hours ✓ 100% money back if not fixed
1 Active Task at a Time
Requests are completed one by one in your priority order. As soon as an active task is shipped, tested, and approved, work starts immediately on your next task within our 24–48h SLA.
48h Emergency SLA
Clock starts as soon as site access details are provided. Delivered with full backup taken first, isolated staging testing, and 100% money back if not fixed.
WordPress Care Plan Scope
Weekly core and plugin updates pre-tested in staging, daily offsite encrypted backups, 24/7 uptime monitoring, and proactive security patching.
Pay Nothing Upfront
Zero upfront payment or credit card required. A 20-Year Senior Engineer diagnoses your issue, reproduces it on isolated staging, and deploys the fix. You only pay once you verify the staging reproduction or production fix.