WordPress errors

How to fix a WordPress memory exhausted error

A WordPress memory exhausted error means a PHP request reached the amount of memory it was allowed to use. The next step depends on whether a legitimate task needs more room or faulty code keeps consuming memory. Record the failing action before raising the limit.

Time: 30-60 minutes for diagnosis and a controlled test Level: Guided troubleshooting
Neil McNaught, founder of BugShield and WordPress author
Written by
Written by
Updated
Updated

Understand why one WordPress task runs out of memory

Opening a builder, importing content or processing an image can stop when the current request runs out of memory. The recorded error helps distinguish that limit from a timeout or another failure. Follow the checks below to find the effective limit, establish what used it and decide whether a hosting adjustment or a plugin repair is the appropriate next step.

Site Health Info Server panel displaying PHP memory limit alongside other server settings
The Server panel displays PHP memory limit so you can record the current allowance before discussing a change with your host. This unchanged 2021 documentation example contains old software and sample limits, not recommended settings. The host must confirm the effective limit for the request that failed. Credit: WordPress Documentation Team, CC0.

Confirm the actual error

Look for Allowed memory size ... exhausted in the recovery email or hosting PHP log. The first number is the permitted memory in bytes; the later allocation figure is the additional amount PHP tried to obtain when it failed. Neither number tells you the total amount the unfinished task would need.

Record whether the error occurs when opening Elementor, uploading one large image, importing products or simply viewing a page. Note the time and latest plugin or PHP changes. If you only see a critical-error message, use the critical-error guide to obtain the underlying error first. An upload-size warning or maximum-execution-time message is a different limit.

Recover access and preserve the current site

Take a backup before changing configuration. If a recently changed plugin prevents the dashboard loading, use Recovery Mode or deactivate that identified plugin through hosting. Leave its feature unavailable until a tested repair is ready.

Ask your host to stop a stuck import or background job if it continues failing. Before restarting an import, check which records were already created and use the importer's documented resume or duplicate-handling option. Re-running the whole file without checking can create duplicate content.

Compare the current limit with the task's requirements

When the dashboard opens, go to Tools > Site Health > Info and expand Server. Record the PHP memory limit and any separate administrative value. Under WordPress Constants, note WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT where available. Ask hosting support for the effective web-request value if the dashboard is inaccessible.

Check the affected plugin's current official requirements and give the host that requirement alongside the error. If the effective limit is below a supported requirement, follow the memory-limit setting guide. It covers the hosting panel, a conditional configuration-file change and how to undo a failed edit. Do not lower a larger existing limit to match an example.

Reduce the work when the task allows it

For an import, test a small sample on a staging copy. Use the importer's batch-size control if it provides one. For an image upload, resize a copy to the dimensions actually needed on the page before uploading; keep the original privately. Our image guide explains that distinction.

If a normal page or editor request fails after one plugin update, test that change using the conflict guide. Keep Elementor or the relevant feature plugin active when testing its operation. The file named in the error is where allocation failed, not conclusive proof that the named component caused all the memory use.

Retest once and decide whether the change is enough

After a supported limit increase or smaller batch, repeat the original task with controlled test data. Confirm completion and inspect its output: imported records, generated images or a saved page. Check that the logged error has not returned for that test time.

If the same request reaches the new limit, stop raising it repeatedly. Give the plugin author or developer the error, versions, effective limit and smallest example that reproduces it. Use private logging only if additional evidence is required, and remove temporary diagnostics afterwards. An unlimited setting transfers the problem to the server instead of identifying its cause.

Reference material

PHP defines the per-script memory limit. WordPress describes its memory configuration settings. Plugin requirements must come from the relevant maintainer.

Get help with the next step

If routine editing still exhausts memory, ask BugShield to investigate the failing operation. The exact action and current limit help us assess whether configuration, a plugin fix or a smaller workload is needed.

Questions answered

How to fix a WordPress memory exhausted error FAQs

Is this the same as running out of hosting storage?

No. PHP memory is working space used while a request runs. Storage holds files and databases. Buying more disk space does not change PHP's per-request memory limit.

Can I calculate the required limit from the error alone?

No. The error shows the configured allowance and the allocation that failed at that moment. The unfinished operation can need further memory, so use documented requirements and a controlled test.

Why does the error name a WordPress core file?

That is where a memory allocation failed. Plugins and themes share the request's memory, so the filename alone does not establish which component created the excessive workload.

Should I set memory_limit to unlimited?

No. Use a bounded value supported by the host and the task. If the error recurs at that value, investigate the operation instead of removing its resource boundary.

Why does only the editor fail?

Administrative work can use a different memory allowance and load different plugin features from a public page. Record the editor action and ask the host to verify its effective limit, including WP_MAX_MEMORY_LIMIT.

Need a hand with your WordPress site?

Tell us what happened and where you got stuck. A BugShield developer can help you work out the next step and confirm a price for the fix.

Explore help with this issue

Accessibility settings

Adjust how this site looks and moves. Your choices are saved in this browser.