A WordPress memory exhausted error means a PHP request ran out of its configured memory allowance. Record the failing action and the complete error first, check the effective limit for that request, then investigate the workload. Raising a limit can restore access, but it does not identify why the request needed more memory.
This guide is for site owners and agencies handling a reproducible failure in an editor, image upload, import, checkout or background task. A slow page without a memory error needs a wider investigation. If the screen only says there has been a critical error, start with our WordPress critical error guide and establish the actual error before changing limits.
Jump to the error evidence, request context, memory settings, workload isolation, a bounded repair or verification.
1. Capture the WordPress memory exhausted error
Keep the full message, timestamp and action that triggered it. Note whether it happened for one administrator, every visitor or one scheduled job. Record recent changes and whether the failure repeats with the same input. A large product import and a small homepage request should not be investigated as though they were the same workload.
For example, an allowance of 268435456 bytes corresponds to 256 MiB. That number describes the configured allowance in the message, not the site’s total hosting RAM. A tiny final allocation can still fail after earlier work has consumed almost all the available memory. The final file and line are a useful starting point, but do not establish which component caused the earlier growth.
Prefer the host’s private PHP error log. If temporary WordPress logging is needed, follow the official debugging guidance, keep errors out of visitor pages, restrict access to logs and remove diagnostic settings when finished. Logs can contain personal data and filesystem details; share a redacted excerpt rather than a public log URL. Do not enable query recording indiscriminately while investigating a memory shortage.
2. Separate the failing request from the rest of the site
Write down the exact route and operation: loading the dashboard, saving a page, generating image sizes, importing a file, processing an order or running a background action. Compare one small input with the failing input on a safe copy. Record what completes, where it stops and whether a partial result was created.
A successful command-line check is useful evidence for that command. It does not prove a browser request has the same PHP configuration, permissions, loaded extensions or execution path. Ask the host to confirm the active web PHP handler and effective configuration as well as any command-line values. Never place a public diagnostic page containing server configuration on the production site.
For store operations, check order and job state before retrying. A visible error does not establish that nothing happened. Repeating a batch without inspecting its partial output can create duplicate work or repeat external effects. Our failed scheduled actions guide covers background-job evidence separately.

3. Read PHP and WordPress memory settings together
PHP’s memory_limit documentation defines the script memory allowance. It is not a measure of total server capacity. The value -1 removes that configured PHP limit, which is unsuitable as a routine troubleshooting shortcut on a shared production service. Version-specific host restrictions and other resource controls can also apply.
WordPress has two relevant configuration constants. WP_MEMORY_LIMIT is the amount WordPress requests for ordinary operation; WP_MAX_MEMORY_LIMIT is used for more demanding contexts such as administration. They are requests within PHP and hosting constraints, not extra pools of RAM. The WordPress PHP optimisation guide explains the relationship.
Read the current definitions before editing wp-config.php. Record the effective PHP value, any host-managed setting and the context of the failing request. Avoid adding duplicate definitions or copying an arbitrary 512M recommendation from another site’s instructions. A number written in a configuration file is not proof the running request received it.
4. Test the workload rather than blaming the last file
Use a recent staging copy with an appropriate backup and disabled external side effects. Reproduce the fault before changing components, then vary one factor at a time. If it only happens with a large export, compare a smaller range. If it follows a recent extension update, compare a compatible known-good setup. Preserve the inputs so another person can repeat the comparison.
Possible investigation routes include oversized queries, unexpectedly large result sets, repeated processing and image operations. These are hypotheses until measured. An error inside WordPress core does not automatically mean core is defective, and an extension filename in the message does not prove that extension alone used the allowance.
Follow the WooCommerce conflict-testing procedure when a store’s components need isolation. Keep required dependencies together and reintroduce components systematically. Our WordPress plugin conflict test gives a practical evidence trail. Avoid disabling payment, security or order-processing components on a live shop simply to see what happens.
5. Choose a bounded repair with a rollback
A legitimate workload may need a host-approved increase. Agree the intended value and relevant context, back up the existing configuration and change one setting through the host’s supported interface. Confirm the effective value afterwards. The wp-config.php reference also warns that increasing memory can hide an underlying problem.
Where the workload can be reduced, consider smaller batches, narrower queries or avoiding repeatedly loading the same large data. Treat these as changes to test, not universal fixes. For an import, retain a progress record and define how already-processed items are recognised before splitting or retrying it. Smaller batches are only useful if the operation still produces complete, correct results.
Do not assume more memory makes every request faster. A higher allowance does not repair a remote API delay, a blocked database query or an infinite processing loop. Ask the host about concurrent worker capacity before increasing limits across a busy service, and keep a recovery route outside wp-admin.

6. Verify the original operation and nearby workflows
Repeat the exact failing action using the original input on staging, then compare output and fresh logs. Check that the operation completes once, that partial work is reconciled and that no new memory error appears. Also test a representative ordinary page and an administration action; for WooCommerce changes, include an approved test purchase path.
Record the before-and-after limit, component versions, input size, result and rollback steps. A single successful retry is a useful result, but a recurring job needs observation when it next runs at its normal size. If the cause remains unknown, say so rather than labelling a larger allowance a permanent fix.
Need help tracing a WordPress memory exhausted error? Contact DriftFix with the affected action, a redacted error and recent changes. We can help separate hosting limits from application workload and agree a focused investigation. Keep passwords and customer data out of the initial enquiry.

