The "Allowed memory size exhausted" fatal error means PHP hit its memory ceiling while building a page. WordPress defaults to only 40MB on the front end, and a host-level cap can silently override anything you set in wp-config.php, which is why the standard fix often fails. We find the layer that is actually limiting you and fix the real memory hog for $49-$99.
The fatal error reading "Allowed memory size of 134217728 bytes exhausted" means PHP hit its per-script memory ceiling while building your page and killed the process mid-render, leaving a white screen or a critical error notice. Two separate limits govern this. PHP itself has a memory_limit setting, which defaults to 128MB per the PHP manual. WordPress then manages its own budget on top: WP_MEMORY_LIMIT defaults to just 40MB for a single site and 64MB for multisite, and WordPress raises itself to 256MB inside the admin area via WP_MAX_MEMORY_LIMIT. The catch that wastes hours of DIY time is that WordPress can only raise these values if the host allows PHP settings to be changed at runtime. On hosts with a hard cap, the wp-config.php constant everyone recommends silently does nothing. That byte number in the error is the effective limit: divide it by 1048576 to get megabytes, and you know exactly which ceiling you hit.
Fix This Error Now →WordPress Memory Exhausted Error can be caused by several issues. Here are the most common.
Out of the box WordPress allots 40MB for a single site, a value set in its own default-constants.php file. A modern stack with a page builder, WooCommerce, and a dozen plugins can need several times that. Sites run fine for months, then one added plugin or one heavy page finally tips a budget that was always nearly full.
WordPress raises its memory limit at runtime only when the server permits runtime changes. If the host enforces a hard memory_limit at the PHP or pool level, defining WP_MEMORY_LIMIT as 256M in wp-config.php changes nothing, silently. This is the single most common reason the standard advice fails and the error persists after the fix.
Page builders, backup plugins that compress archives in-request, image optimizers, and security scanners are the usual heavyweights. Elementor's own system requirements call for a 256MB WordPress memory limit at minimum. One plugin that loads its full machinery on every page raises the floor for the entire site.
Loading thousands of products, variations, or orders into a single request consumes memory in proportion to the data. Plugins that query without limits, export tools that build entire spreadsheets in memory, and themes that render every product for a mega-menu are classic triggers on stores that grew past their original size.
When you upload a photo, WordPress generates multiple resized copies, and decoding a large original for processing can take far more memory than the file size suggests. A 20 megapixel photo can exceed a small limit on its own, which is why memory exhaustion often first appears as a failed media upload rather than a broken page.
Imports, bulk edits, and cron jobs that accumulate data on every iteration grow until they hit the ceiling, reliably dying at the same record count each run. Raising the limit moves the crash point without fixing it. The signature is a process that always fails partway through the same long task.
WordPress loads every autoloaded row from the wp_options table on every single request, before it renders anything. Plugins that stuff logs or caches into autoloaded options can quietly grow this to many megabytes, taxing the budget of every page load. Site Health flags total autoloads above 800KB for exactly this reason.
WordPress gives the admin area a larger budget, 256MB by default, because editors, list screens, and builder edit modes are heavier than public pages. When the front end works but editing a page or opening the media library crashes, the admin ceiling is the one being hit, and it has its own constant to adjust.
Some budget plans hard-cap PHP memory low and disallow raising it entirely. If your stack legitimately needs more than the plan allows, no configuration edit anywhere will fix it. Recognizing this early saves days: the fix is a plan upgrade or a host move, and we tell you honestly when that is the case.
Pull the exact fatal error from the debug log. It names the file and line that requested the failed allocation and states the effective limit in bytes, which tells us both the ceiling and a first suspect
Measure the real effective memory limit at every layer: the server's php.ini or pool setting, WP_MEMORY_LIMIT, and WP_MAX_MEMORY_LIMIT, because a mismatch between them explains why previous fix attempts did nothing
Raise WP_MEMORY_LIMIT correctly in wp-config.php, placed before the wp-settings.php include as the WordPress documentation requires, then verify the running value actually changed
If the host's hard cap is the binding limit, raise memory_limit at the server level through php.ini, the hosting panel, or the host's support, which is the step DIY guides skip
Identify what is actually consuming the memory: if a raised limit only delays the crash, we profile the request and isolate the plugin or theme responsible instead of feeding it more
Audit autoloaded options and trim the bloat so every request stops paying a multi-megabyte tax before rendering begins
Reproduce the crash scenario deliberately, whether that is a specific page, a media upload, or a WooCommerce screen, and confirm it survives after the fix
Convert leaky bulk jobs to batched processing so imports and exports finish instead of dying at the same record every time
Check image processing settings if uploads triggered the error, and route genuinely oversized originals out of the pipeline
Give you a straight answer on hosting: if the stack legitimately needs more memory than the plan can provide, we say so and recommend the cheapest adequate tier rather than leaving you in a crash loop
Fixed in 2 hours or your money back. We do not waste time.
No hourly billing. You know the price before we start.
Cannot fix it? You do not pay. Zero risk to you.
Our Plugin & WordPress Errors team has fixed thousands of sites with this exact issue. 2-hour turnaround, guaranteed.
PHP enforces a per-script memory ceiling, and your page hit it mid-render, so PHP terminated the script with a fatal error. The number is the ceiling in bytes: 41943040 is 40MB, 134217728 is 128MB, 268435456 is 256MB. Divide by 1048576 to convert. Knowing the number matters because it tells you which layer's limit you hit, the WordPress default, the host's PHP setting, or a raised value that is still too small for one heavy operation.
Add define WP_MEMORY_LIMIT with a value like 256M to wp-config.php above the line that includes wp-settings.php. The placement matters: the WordPress documentation notes the constant must be set before wp-settings.php loads. For admin-area crashes, WP_MAX_MEMORY_LIMIT is the constant to raise instead, since WordPress uses a separate, higher budget in the dashboard, 256MB by default per the core source.
Because WordPress can only raise PHP's memory limit when the server allows runtime changes to it. WordPress core checks whether memory_limit is changeable, and when a host locks it at the PHP or pool level, your constant is silently ignored and the effective ceiling stays wherever the host set it. The fix has to happen at the server layer: php.ini, the hosting panel's PHP settings, or a request to the host. This one behavior explains most failed DIY attempts we see.
Core WordPress by itself is modest, which is why its default is only 40MB. Real installations need more because of what runs on top: Elementor's published requirements ask for 256MB at minimum, WooCommerce stores and sites with many active plugins are comfortable at 256MB, and heavy stores or import-heavy sites sometimes justify 512MB. More than that usually signals a leak or a runaway query rather than a legitimate need, and feeding it more memory just delays the crash.
The limit applies per request, and requests differ enormously in weight. A simple blog post might use 60MB while a page built with a heavy builder, a filtered shop archive, or a media library screen needs triple that. The crash appears exactly where the biggest allocation happens, so the failing page is diagnostic evidence. It usually points directly at the plugin or template doing the heavy lifting.
It depends on the shape of the failure. If the site needed more than an undersized default and runs cleanly at 256MB, raising the limit is the complete fix. If the error keeps returning at higher and higher limits, or a long task always dies partway through, something is accumulating memory and the limit is not the problem. We distinguish the two by profiling before we conclude, because handing a leak more memory just schedules the next outage.
No. Memory exhaustion is an execution failure: PHP stopped building the page, but nothing was deleted or corrupted. Your database and files are untouched. The one caveat is a half-completed operation, for example an import or update that died midway, which can leave that specific task in an unfinished state worth checking once the site is stable.
Most memory fixes cost $49-$79. Correcting the limits at the right layer and verifying stability sits at the low end. Tracking down a leaking plugin, cleaning up autoload bloat, or converting a dying import into batched processing is $79-$99. You get a firm quote before we start, and if we cannot fix it, you pay nothing.
Our average memory exhaustion fix takes about 31 minutes. Reading the fatal error and measuring the effective limits at each layer takes minutes and usually identifies the binding constraint immediately. The longer cases are the leak hunts, where we profile which component is consuming memory, and even those nearly always close within the 2-hour guarantee window.
Set the memory limit deliberately rather than by crisis: 256MB is a sensible floor for a plugin-rich site. Prefer well-maintained plugins and retire abandoned ones, keep an eye on Site Health's autoloaded options warning, run large imports and exports in batches, and size hosting to your actual stack instead of the cheapest tier. A debug log that someone actually reads once a month catches the early warnings before visitors ever see a white screen.
Every technical claim on this page traces back to primary documentation and the named vendor references below.
Plugin, theme, critical error, PHP, and update fixes in one place.
Visit the WordPress Repair hub →Get wordpress memory exhausted error fixed today. Expert engineers. 2-hour guarantee.
Fix My Error Now →