ZenWeb - Blog - WordPress Memory Limit Exhausted? How to Fix the Error

WordPress Memory Limit Exhausted? How to Fix the Error

November 6, 2026

Share this post:

WordPress Memory Limit Exhausted? How to Fix the Error
TL;DR: A “WordPress memory exhausted” error means a page or task needed more PHP memory than your server allows. Raise the limit by adding define( 'WP_MEMORY_LIMIT', '256M' ); to wp-config.php, and raise PHP’s own memory_limit in your hosting panel if needed. If the error comes back, a heavy plugin, huge image or bloated database is the real cause. Most sites are fixed within an hour.

You click Update on a product page, open the Elementor editor or import some data, and WordPress stops with a line like “Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes)”. Sometimes you only see “There has been a critical error on this website” or a blank page. Customers may see the same thing.

The good news: the WordPress memory exhausted error has a name, a number and a file path, so it is easier to diagnose than a generic crash. If your site only shows a bare “500 Internal Server Error” with no memory message, start with our guide to fixing a 500 internal server error instead.

This guide is for Malaysian business owners who need the site working today. It ranks the causes, gives the fix (checked against WordPress’s official documentation in October 2026), realistic timings, prevention and when to hand it over.

This short video walks through raising the memory limit and checking plugins and themes, the same order we use below.

How to Solve Allowed Memory Size Exhausted WordPress Error — wppluginsforyou

Source video: Watch on YouTube (wppluginsforyou)

1. What Does “Allowed Memory Size Exhausted” Mean?

Quick Answer: It means PHP, the language WordPress runs on, hit its memory ceiling while building a page or running a task, so it stopped. The first number in the message is your current limit in bytes. The file path at the end usually points to the plugin or theme that was running when memory ran out.

Every time someone loads a page, PHP sets aside memory to run WordPress, your theme and every active plugin. The server caps how much one request can use. PHP’s own manual lists the memory_limit setting with a default of 128M, and many hosts change it. When a request needs more, PHP stops with a fatal error. Use the table below to turn the bytes in your message into a limit you can read:

Reading the Error: Bytes in the Message vs Your Actual Memory Limit
Common byte values in the WordPress allowed memory size exhausted error, converted to megabytes, with what each usually means.
Bytes in the errorLimitWhat it usually means
41,943,04040 MBWordPress’s own default for a single site. Too low for most business sites.
67,108,86464 MBA low cap common on older or budget shared hosting.
134,217,728128 MBPHP’s default. Fine for a brochure site, tight for WooCommerce or page builders.
268,435,456256 MBAlready generous. Hitting this usually points to a faulty plugin or task, not a low limit.
536,870,912512 MBSomething is looping or loading far too much data. Raising the limit further rarely helps.

Source: Byte-to-megabyte conversions (1 MB = 1,048,576 bytes); defaults from the WordPress Advanced Administration Handbook and the PHP manual. Interpretation from ZenWeb WordPress support across Malaysian client sites, 2024–2026.

The “tried to allocate” number is often tiny; it just means the request was already at the ceiling. Read the file path at the end. A path containing /wp-content/plugins/plugin-name/ names the plugin running when memory ran out.

Key takeaway: The first number tells you whether your limit is low (64–128 MB) or already high (256 MB and up). A high limit means you are hunting for a memory hog, not just raising a setting.

2. What Causes the WordPress Memory Exhausted Error?

Quick Answer: The most common cause is simply a limit set too low for what the site now does, such as adding WooCommerce or a page builder. Next come a single heavy or faulty plugin, oversized image uploads, bulk imports and exports, and a bloated database. Hosting that caps memory below what WordPress asks for comes last.

WordPress’s Common WordPress Errors guide lists “Allowed memory size exhausted” under fatal errors, and also names the memory limit as a common cause of the “critical error” message. Here is how the triggers rank on the business sites we support:

What Triggers the WordPress Memory Exhausted Error — Share of ZenWeb Cases
Triggers behind WordPress memory exhausted errors on Malaysian SME sites, ZenWeb client tracking 2024 to 2026.
TriggerShare of cases
Limit too low after adding WooCommerce or a page builder

34%

One heavy or faulty plugin (often after an update)

26%

Very large image uploads (phone photos, 5–15 MB each)

16%

Bulk imports, exports or backups run in WP Admin

12%

Bloated database (autoloaded options, old logs)

7%

Hosting plan hard-caps PHP memory

5%

Source: From ZenWeb client tracking of Malaysian SME WordPress sites, 2024–2026. Illustrative of typical patterns, not WordPress.org data.

Timing is your best clue. If the error started straight after a plugin update, suspect that plugin. If it only appears when you open the page builder, the builder needs more memory; our guide to Elementor not loading covers the editor spinner that often comes first. If it appears when you upload photos or import products, the task is the problem.

Key takeaway: Six in ten cases come down to a low limit or one greedy plugin. Note what you were doing when the error appeared, because that points straight at the cause.

Rather not edit wp-config.php yourself?

We build and maintain WordPress sites for Malaysian businesses, sized for the plugins and traffic they actually run. See our WordPress web design services →


3. How Do You Check Your Current PHP Memory Limit?

Quick Answer: If you can still log in, go to Tools > Site Health > Info. The Server section shows PHP’s memory limit, and WordPress Constants shows WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT. If you are locked out, read the bytes in the error message or check PHP settings in your hosting panel.

WordPress’s Site Health screen documentation confirms the Info tab’s Server section shows your PHP settings, and notes that many server values can only be changed by your host. Look for three values:

  • PHP memory limit (Server section). The ceiling the server sets. WordPress cannot go above this, whatever you put in wp-config.php.
  • WP_MEMORY_LIMIT (WordPress Constants). How much WordPress asks for on the public site.
  • WP_MAX_MEMORY_LIMIT (WordPress Constants). How much WordPress asks for in WP Admin tasks such as updates and image editing.

Locked out of WP Admin? Check the site admin’s inbox for WordPress’s recovery mode email, or see our guide to being locked out of WordPress admin. A blank page with no message is covered in our WordPress white screen fix.

Key takeaway: WordPress can only ask for memory up to the server’s limit. Check both numbers before you edit anything, or you may raise one and wonder why nothing changed.

4. How to Fix the WordPress Memory Exhausted Error Step by Step

Quick Answer: Back up wp-config.php, then add define( 'WP_MEMORY_LIMIT', '256M' ); above the “That’s all, stop editing!” line. If the error stays, raise PHP’s memory_limit to 256M in your hosting panel’s PHP settings. Clear caches and repeat the action that failed. If your host caps memory, ask them to raise it.

These steps follow the “Increasing memory allocated to PHP” section of WordPress’s official wp-config.php guide, checked in October 2026. Most Malaysian hosting plans use cPanel or Plesk:

  1. Log in to your hosting control panel. If you lost the login, ask your host to reset it to the email on the account, usually your SSM-registered business email.
  2. Open File Manager and find wp-config.php. It sits in your WordPress root folder, usually public_html, next to wp-admin and wp-content.
  3. Download a copy first. One typo in this file can take the whole site down, so keep a backup you can upload again.
  4. Add the memory lines. Above the line /* That's all, stop editing! */, add define( 'WP_MEMORY_LIMIT', '256M' );. For heavy admin tasks, also add define( 'WP_MAX_MEMORY_LIMIT', '512M' );.
  5. Save and test. Clear your caching plugin and repeat the action that failed, such as saving the page or running the import.
  6. Raise PHP’s limit if the error stays. In cPanel, look for the PHP settings tool (often MultiPHP INI Editor or Select PHP Version > Options) and set memory_limit to 256M. In Plesk, open PHP Settings for the domain.
  7. Ask your host if you hit a cap. If the panel will not let you go higher, open a ticket asking them to raise PHP memory to 256M for your domain.

Skip the old php_value memory_limit line in .htaccess unless your host supports it; on many servers it causes an instant 500 error. Never edit core files such as default-constants.php, because updates overwrite them. WordPress’s own guide warns that a higher limit can hide a deeper problem, which the next section tackles.

Key takeaway: 256M in wp-config.php plus 256M in your PHP settings fixes most sites. Back up the file first and change nothing else in it.

5. What If Raising the Limit Doesn’t Fix It?

Quick Answer: If the error returns at 256 MB or more, something is using far more memory than it should. Use the file path in the error to find the plugin, deactivate it, and test again. If no plugin is named, switch to a default theme, then check image sizes, imports and database size.

On a staging copy, or during a quiet hour, deactivate plugins one at a time. If WP Admin is down, rename the plugin’s folder in wp-content/plugins to switch it off. Turning on WordPress’s debug log records the full error with its file path. Match what you see to this table:

When the Error Comes Back: Where It Appears, Likely Culprit and Next Step
Where the WordPress memory exhausted error appears, mapped to the likely culprit and next step.
Where it appearsLikely culpritNext step
Every page, right after an updateThe plugin or theme just updatedRoll back to the previous version and report it to the developer
Only in the page builder editorBuilder plus too many add-on widget packsRemove unused add-ons; raise WP_MAX_MEMORY_LIMIT
When uploading photosHuge phone or camera images being resizedResize to about 2,000 px wide before uploading
During product import or exportToo many rows processed in one goSplit the CSV into smaller batches
On checkout or cart pagesA shipping, payment or discount pluginTest each checkout add-on on staging
Randomly, getting worse over timeBloated database or autoloaded optionsClean old logs, revisions and leftover plugin data

Source: Compiled by ZenWeb from the WordPress Advanced Administration Handbook and Malaysian client site repairs, October 2026.

On a shop, a WordPress memory exhausted error costs sales fastest. After the fix, check for orders stuck on pending payment, a missing add to cart button, shipping not showing at checkout and order emails not sending.

Key takeaway: A higher limit is a painkiller, not a cure. Where the error appears tells you which plugin, upload or task to fix.

6. How Long Does It Take to Fix?

Quick Answer: Editing wp-config.php takes about 10 minutes. Changing PHP settings in your hosting panel takes about 15 minutes. A host support ticket usually takes a few hours to one working day. Tracking down a faulty plugin or cleaning a database can take a few hours to two days.

Typical Time to Fix the WordPress Memory Exhausted Error
Typical time to fix a WordPress memory exhausted error for each type of fix, ZenWeb operational observations 2024 to 2026.
FixTypical time
Add WP_MEMORY_LIMIT to wp-config.php

10 min

Raise memory_limit in hosting panel

15 min

Host raises a capped limit (support ticket)

2 hours – 1 working day

Find and replace a faulty plugin

1–6 hours

Database clean-up or move to a bigger plan

1–2 working days

Source: ZenWeb operational observations across Malaysian client WordPress sites, 2024–2026. Host support times vary by plan and are not guaranteed.

While the site is down, pause ads that send paid clicks to broken pages. Shopping products linking to an error page can stop serving (see Google Shopping ads not showing), and if a Meta relaunch stalls, see our fix for an ad set that can’t be published.

Is your hosting the real bottleneck?

If your plan caps memory at 128 MB, no wp-config edit will save a busy shop. Check our web design and maintenance packages →


7. How to Stop the Memory Error Coming Back

Quick Answer: Keep plugins lean, resize images before upload, run big imports in batches, and clean the database every few months. Update one plugin at a time with a backup. Choose hosting with at least 256 MB of PHP memory if you run WooCommerce or a page builder.

Preventing a repeat WordPress memory exhausted error is mostly habit. These are the routines we use on sites we maintain:

  • Audit plugins twice a year. Remove anything you no longer use. Our list of the WordPress plugins a business site actually needs helps you trim.
  • Update in small, backed-up steps. Bulk updates on low-memory hosting are also the main reason sites get stuck in maintenance mode.
  • Resize images first. Phone photos are often 4,000 px wide or more. Shrink them before they reach the Media Library.
  • Size hosting for the site you have now. A shop on a starter plan will hit limits as it grows; compare managed WordPress hosting prices in Malaysia.
  • Watch for warning signs. Slow saves and a spinning editor often come before the fatal error.

If you would rather someone else watched this, our guide to website maintenance in Malaysia explains what a proper plan covers. Keeping plugins current is also part of WordPress website security.

Key takeaway: Fewer plugins, smaller images and hosting sized for your shop stop most repeat memory errors. Treat slow saves as an early warning.

8. When Should You Call ZenWeb?

Quick Answer: Call for help when the error persists at 256 MB or more, when you cannot find the plugin responsible, when your host refuses to raise the cap, or when checkout is affected. Also call if you see other errors alongside it, because those can point to a deeper server or security issue.

Escalate if you see any of these:

ZenWeb is a Google Partner agency that has worked with 500+ Malaysian businesses. Our web design services cover building and maintaining WordPress sites, so we can find the memory hog and size your hosting so the error stays away. Host support queues are outside our control, but we will manage that ticket for you.

Key takeaway: Raising the limit is a safe DIY job. Repeat errors at high limits, checkout failures and mixed error messages are where an expert saves you time and lost sales.

9. Conclusion

A WordPress memory exhausted error means PHP hit its ceiling. Read the bytes in the message, raise WP_MEMORY_LIMIT to 256M in wp-config.php, and raise PHP’s memory_limit in your hosting panel if needed. If the error returns, use the file path to find the plugin, upload or task behind it, then keep it away with lean plugins, smaller images and hosting sized for your site. Seeing “page not found” instead? Read what a 404 error is. For more help, visit the ZenWeb home page.


10. Frequently Asked Questions

1. Is 256M a safe memory limit for WordPress?

Yes. 256 MB is a common, sensible limit for business sites running WooCommerce or a page builder. It is a ceiling, not a reservation, so a page that needs 60 MB still uses only 60 MB. Going far above 512 MB usually hides a faulty plugin rather than fixing anything.

2. Why didn’t adding WP_MEMORY_LIMIT to wp-config.php work?

Usually because the server’s PHP memory_limit is lower than what you asked for, and WordPress cannot go above it. Check Tools > Site Health > Info > Server. Also make sure the line sits above “That’s all, stop editing!”, not below it.

3. Will a higher memory limit slow down my website?

No. The limit only sets the maximum one request may use. It does not make pages heavier. Speed depends on what your plugins and theme actually do, so a slow site needs a performance review, not a lower limit.

4. Can the memory exhausted error hurt my Google rankings?

A short outage is unlikely to have a lasting effect. If pages return errors for days, Google may crawl less and drop affected pages until they recover. Fix the error quickly, then check Search Console for crawl errors on your key pages.

Cite this page: ZenWeb (2026). WordPress Memory Limit Exhausted? How to Fix the Error. https://zenweb.my/blog/wordpress-memory-limit-exhausted/

You may quote our data with this credit and a link. See our Terms of Use.

Still seeing “allowed memory size exhausted”?

Send us the full error message and what you were doing when it appeared. We will find what is using the memory, fix it and make sure your hosting can handle your site.

Fix my WordPress site →

Table of Contents
Table of Contents

Get A Free Proposal

Complete the form and our team will contact you to discuss your goals. Let’s grow your business.