A site can look perfectly fine one minute, then flash a white screen and stop mid-task the next. That is often a WordPress memory exhausted error, and it usually means PHP ran out of room before WordPress could finish its work.
It sounds technical, but the fix is often straightforward. You need to find what is using the memory, raise the right limit when needed, and make sure your hosting plan has enough resources for the site you are running.
Let’s start with the error itself, because the wording tells you more than most people realize.
Read the Error Before Changing Anything
A PHP memory error often reads like this: “Allowed memory size of 134217728 bytes exhausted.” That number looks ugly, but it simply means the script hit its assigned memory ceiling.
The failure may happen while loading a page, editing with Elementor, running a WooCommerce update, importing products, or creating a backup. The task matters. It points toward the real cause.
Find the file named in the error
Look at the end of the message for a plugin, theme, or WordPress core file path. If the error points to wp-content/plugins/, a plugin is likely involved. If it appears inside a theme folder, the theme or custom code deserves a closer look.
Don’t assume that named file is always broken. It may only be the final task that failed after another plugin used too much memory earlier in the request.
Know the difference between a memory limit and a memory leak
A site can exceed memory because its PHP limit is too low. It can also exceed memory because a plugin, theme, or custom function uses more RAM than it should.
Raising the limit may get the site back online. It won’t repair bad code or make an oversized import disappear. We recommend treating a higher limit as breathing room, not a blind fix for every problem.
If the error returns after a reasonable memory increase, the site is telling you to investigate the workload, not keep adding more memory.
Protect the Site and Isolate the Trigger
Before touching wp-config.php or server settings, create a full backup. A small edit can cause a syntax error, and a safe restore point changes the whole mood of the job.
A reliable website backup service gives you a way back if a plugin update, file edit, or failed import makes matters worse. Backups are not glamorous, but they are the safety net that lets you fix problems without panic.
Reproduce the failure on purpose
Try the action that causes the error. Open the affected page, start the import, save the product, or run the update again. Take note of the time and the exact step.
Then check WordPress debug logs if logging is enabled. The wp-content/debug.log file may show a clearer PHP message than the visitor-facing error screen. Your hosting error log can also identify the script and timestamp.
Test plugins without guessing
If you can access the WordPress dashboard, deactivate the most likely plugin first. Start with page builders, WooCommerce add-ons, backup tools, security scanners, bulk image plugins, importers, and analytics tools.
If the dashboard is unavailable, use cPanel File Manager or SFTP. Rename the suspected plugin folder inside wp-content/plugins, then test the site again. WordPress will treat that plugin as inactive.
Use a simple order:
- Disable one likely plugin and repeat the failed action.
- Reactivate it if nothing changes, then test the next candidate.
- Switch temporarily to a default WordPress theme if plugins are not the issue.
- Update or replace the item that reliably triggers the failure.
This process is slower than flipping every switch at once. It is also how you avoid creating a second problem while chasing the first one.
Fix a WordPress Memory Exhausted Error in wp-config.php
WordPress has its own memory constants, and wp-config.php is where you set them. The official wp-config.php documentation confirms that WordPress uses WP_MEMORY_LIMIT for normal site activity and can use a higher limit for administration tasks.
On a single WordPress site, the default front-end memory setting is 40M. Multisite starts at 64M. Those numbers can feel small once you add a visual builder, online store, cache plugin, forms, and a few business tools.
Add the two memory constants carefully
Open the wp-config.php file in the root folder of your WordPress installation. Find the line that says: “That’s all, stop editing! Happy publishing.”
Place these lines directly above it:
define( 'WP_MEMORY_LIMIT', '256M' );define( 'WP_MAX_MEMORY_LIMIT', '256M' );
WP_MEMORY_LIMIT covers regular site requests. WP_MAX_MEMORY_LIMIT is for the WordPress admin area, where updates, media processing, imports, and store management can need more room.
For a small brochure site, 128M may be enough. We often start active business sites at 256M when the server supports it. A busy WooCommerce store, membership site, or builder-heavy site may need more, but the number should match a real workload.
Save the file, clear any server or plugin cache, then repeat the action that failed.
Don’t add duplicate settings
Search wp-config.php before adding anything. If the constants are already present, edit the existing value instead of adding another copy.
A duplicate line can create confusion. One setting may appear to work while another silently wins. Keep the file clean, save a copy before editing, and avoid changing unrelated lines.
Check the PHP Memory Limit at the Hosting Level
This is where many fixes stall. WordPress cannot grant itself more memory than PHP allows at the server level.
If WP_MEMORY_LIMIT says 256M but PHP is capped at 128M, the site may still fail at 128M. The WordPress setting is a request, not a way around your hosting account’s hard limit.
WooCommerce also makes this distinction in its memory-limit troubleshooting guide. You may raise the limit in WordPress, but sometimes the host must raise PHP’s memory_limit too.
Check the limit in cPanel
Most hosting accounts let you review PHP settings through cPanel. Look for MultiPHP INI Editor, Select PHP Version, PHP Options, or a similar tool. The label varies by host.
Find memory_limit, set the needed value, save the change, then test the failing task again. If there is no PHP setting available, contact support and ask for the PHP memory limit on your domain.
With cPanel hosting for WordPress, routine file and PHP-setting work is easier to reach, which matters when a quick fix cannot wait for a developer.
Avoid random edits to php.ini and .htaccess
Some old tutorials suggest placing memory directives in .htaccess or creating a custom php.ini file. Those methods only work on certain server setups. On others, they do nothing or trigger a 500 error.
Use the hosting dashboard first. If you need file-level help, follow your host’s current instructions. The WordPress memory-limit walkthrough from Jetpack also starts with wp-config.php, which remains the cleanest first move for most sites.
Reduce the Work PHP Has to Do
More memory is useful. Less waste is better.
A WordPress memory exhausted message often appears when several heavy jobs collide. Picture a small moving truck packed with furniture, boxes, and appliances. Adding a larger truck helps, but removing what you don’t need is the smarter long-term move.
Audit large plugins and duplicate features
Check your active plugins for overlap. You may have two cache plugins, several image optimizers, multiple form tools, or a security stack with repeated scanning features.
Deactivate and remove plugins you no longer use. Keep active tools updated. Old plugins can carry compatibility issues and consume resources during admin requests.
Be careful with page builders and add-ons. Elementor, Divi, WooCommerce, LearnDash, and similar tools can run well on WordPress, but each has resource needs. Add-ons should earn their place.
Handle imports and media in smaller batches
A 20,000-product CSV import is not the same job as adding a blog post. Large imports, image regeneration, database cleanup, backup creation, and bulk edits can burn through memory fast.
Break imports into smaller files when possible. Run demanding jobs during quieter hours. Use a staging site to test big plugin updates or database work before you hit the live site.
For online stores, our WooCommerce hosting checklist covers the server resources that become important as products, traffic, and extensions add up.
Know When Hosting Is the Real Fix
A healthy site should not hit its memory ceiling every week. If you need frequent manual increases, the hosting plan may be too small for the site you have built.
Shared hosting can be a sensible home for a new portfolio, local service site, or low-traffic blog. A growing store or resource-heavy membership site needs steadier CPU, RAM, and PHP workers.
Match the plan to the workload
Look at traffic, catalog size, active plugins, editing habits, and peak sales periods. A site with 50 products has different needs than one with 5,000 products and live inventory updates.
For growing sites, managed WordPress hosting gives you a stronger foundation with WordPress-focused performance, backups, security tools, and support when something goes sideways. That is time you can spend selling, serving customers, and building the business.
When the site needs isolated resources and more control, a VPS is often the next sensible move. This shared hosting and VPS comparison explains the practical difference: shared plans divide resources among accounts, while a VPS gives your site its own allocated slice.
Don’t buy more power out of fear. Buy it when your site’s workload has outgrown its current home.
A Stable Site Starts With Enough Room
The fastest fix for a WordPress memory exhausted error is often a careful wp-config.php update paired with the right PHP limit. But the lasting fix comes from finding the workload that caused the crash.
Keep plugins lean, split demanding jobs into smaller pieces, and protect every change with a current backup. When memory errors become routine, stronger hosting is not an extra expense. It is the room your website needs to keep working when business picks up.






