WordPress
WordPress PHP Memory Limit Fix
Fix "allowed memory size exhausted" errors by correctly raising WordPress's PHP memory limit.
The Problem
A fatal "memory exhausted" error usually means WordPress genuinely needs more memory than it's been given — but there are three or four places that limit can be set, and changing the wrong one does nothing.
About this problem
The memory available to WordPress is capped in several layers: the WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT constants in wp-config.php, the memory_limit directive in php.ini or a per-site PHP setting, and sometimes a hard cap enforced by the hosting plan. The effective limit is the lowest of them, so raising one value without checking the others has no effect.
People usually come looking for this after seeing the message about allowed memory size being exhausted during an import, a plugin update, a page builder save or a WooCommerce task. The error often appears only for heavy operations, which makes it look random.
What's Included
- Identifying exactly where the current memory limit is being capped
- Raising it correctly at the right level (wp-config, php.ini, or hosting panel)
- Confirming the specific error that triggered this is now resolved
- Checking the new limit is sensible, not just "turned up to maximum"
What's NOT Included
- Fixing a plugin that's genuinely leaking memory due to a bug (would be flagged separately)
- Server-level PHP configuration beyond what affects this site
- Hosting plan upgrades if the host enforces a hard cap
How It Works
- I read the exact error message in the log to see how much memory was allowed and which file hit the limit.
- I check the values in wp-config.php, php.ini or per-site PHP settings and the hosting panel to find which one is actually in effect.
- I raise the limit at the correct level to a sensible figure for your site, not simply the maximum.
- I confirm the new value by checking the Site Health information and the PHP configuration for the site.
- I repeat the action that triggered the error to confirm it now completes.
- I note whether a plugin appears to use an unusually large amount of memory so you know if a deeper problem is likely.
In practice: you buy the service, send over whatever access or details the job needs, I investigate and do the work, and you confirm it's resolved before we call it done.
Frequently Asked Questions
- How do I fix allowed memory size exhausted in WordPress?
- Find which level is capping memory and raise it there. Changing only wp-config.php often does nothing if PHP or the host sets a lower limit.
- How much memory should WordPress have?
- It depends on the site, but a common range is a few hundred megabytes for sites with page builders or WooCommerce. I choose a sensible value instead of the maximum.
- What if my host will not allow a higher limit?
- If the host enforces a hard cap, a plan upgrade may be needed, which is outside this service.
- What if a plugin is leaking memory?
- That would need a separate fix. I will tell you if it looks like the real cause.
- Do you change other PHP settings?
- Only those affecting this site and this specific error. Wider server PHP configuration is not included.
- Will the error come back?
- If the underlying need was simply a low limit, no. If a plugin consumes memory without bound, it could reappear.