HireWebDeveloper.net

Problem × WordPress

WordPress memory exhausted error

allowed memory size exhausted

Why it happens

PHP gives each request a memory budget. WordPress sites exhaust it doing real work: resizing a 40-megapixel upload, rendering a page through three stacked page builders, a backup plugin walking the whole site, or an import looping through thousands of products. The error names the line that tripped the limit; the cause is the work, not usually that line.

The three ceilings. Memory limits exist at three levels and the lowest one wins: the server’s PHP memory_limit, the host’s hard cap, and WordPress’s WP_MEMORY_LIMIT in wp-config. Raising wp-config above the host cap does nothing; raising PHP’s while WP_MEMORY_LIMIT stays low helps less than it should.

Raising it hides some causes. A runaway loop dies at any limit; feeding it more memory just delays the crash.

Triage

Site Health (or WooCommerce > Status) shows the active limit. Raise WP_MEMORY_LIMIT to 256M and WP_MAX_MEMORY_LIMIT to 512M in wp-config, retest the failing action. Works now? You were simply under-provisioned; note it and move on. Same crash? The error line names the plugin or theme function responsible: update or remove it. A backup plugin crashing nightly, an importer dying mid-catalogue: raise the limit for the batch AND run it in smaller chunks.

When to bring us in

Memory errors during imports, migrations, or on a site that keeps growing heavier are an architecture signal: we profile what is eating the budget, fix the offender, and set sane limits at the right layer. Routine under a care plan; urgent when the site is down right now - emergency support covers that.