How to Increase Memory Limit WordPress and Fix Fatal Errors
Editorial Note We may earn a commission when you visit links from this website.

Ever run into the dreaded "Allowed memory size of… exhausted" error? It’s a classic WordPress headache. This message is your server’s not-so-subtle way of telling you it's tapped out of resources needed to run your site's scripts. Think of your WordPress memory limit as the RAM your site has to perform every single task, from loading a simple page to processing a complex WooCommerce order.

Why Your WordPress Site Runs Out of Memory

A stressed man with glasses and a beard works on a laptop, a 'MEMORY EXHAUSTED' sign above.

Every plugin you install, every high-res image you upload, and every visitor clicking around your site eats up a slice of that memory. Modern WordPress sites, especially those built with dynamic tools like the Divi Builder or managing an e-commerce platform like WooCommerce, are far more resource-hungry than the simple blogs of the past.

What Consumes WordPress Memory

Honestly, the default memory allocation from most hosting providers just doesn't cut it for anything beyond a basic blog. I've seen countless sites hit their limit because of a few common culprits, which can lead to sluggish performance or, worse, outright crashes.

Here’s what’s usually eating up your memory:

  • Complex Plugins: Page builders, beefy security scanners, and backup solutions are notorious for requiring significant memory to do their jobs.
  • Heavy Themes: Feature-packed themes like Divi naturally have higher memory demands right out of the box.
  • High-Resolution Media: The process of uploading and displaying large images or videos can create temporary, but massive, memory spikes.
  • Traffic Surges: Each visitor runs processes on your server. During peak hours, that usage multiplies fast.

WordPress has certainly tried to keep up. The default limit has climbed from a tiny 8MB in the early days to a more reasonable 32MB. Since version 2.5, WordPress even attempts to automatically bump this to 40MB for single sites and 64MB for multisite networks if needed.

But in the real world, this is rarely enough. Based on what I've seen, 70-80% of sites hitting memory errors require a manual increase. For any serious site using a page builder or running an e-commerce store, you should be aiming for 256MB to 512MB just to keep things running smoothly. WPZOOM has a great write-up on the history of WordPress memory needs if you want to dig deeper.

Key Takeaway: A low memory limit isn't just a technical glitch. It's a business problem. It causes your site to crash during sales, stops you from running critical updates, and delivers a slow, frustrating experience that sends potential customers packing. Being proactive about your memory limit is non-negotiable for a stable, growing website.

Before you start tweaking files and adding code, you need a baseline. Trying to increase your WordPress memory limit without knowing what it is currently set to is like driving in the dark—you might get there, but you'll probably hit a few bumps along the way.

Fortunately, figuring out your current limit is simple, and you don’t need to be a developer to do it.

Check the Site Health Tool

Ever since WordPress 5.2, a handy diagnostic tool called Site Health has been baked right into the core. It’s a goldmine of information about your site’s server environment and configuration.

To find it, just head over to Tools > Site Health in your WordPress admin menu. From there, click the "Info" tab. You'll see a long list of technical details about your setup.

Scroll down and click to expand the "Server" section. Look for the line that says "PHP memory limit"—that’s your number. It tells you the absolute maximum amount of memory your site is allowed to use.

Here’s what you’re looking for on that screen:

In this example, the limit is 256M. That's a solid number for most sites, especially if you're running heavier tools like Divi or WooCommerce. If your site shows a lower value, like 64M or 128M, that's a red flag. It’s almost certainly time for an increase.

Use a Plugin for a Quicker Glance

If you'd rather not dig through the Site Health tool, or if you manage multiple sites and want a consistent dashboard view, a plugin can be a great shortcut. I often recommend WP-ServerInfo for a quick diagnosis.

It’s lightweight and gets straight to the point. Once installed, it adds a new item to your dashboard menu that lays out all the key server stats, including the memory limit, in one clean view. It's a real time-saver.

Crucial Distinction: It’s vital to understand the difference between the WordPress-specific limit (WP_MEMORY_LIMIT) and the server's global PHP memory limit. The value you see in Site Health is the server's cap. While you can define WP_MEMORY_LIMIT in your wp-config.php file, WordPress can never use more memory than the server allows. If your host has set a hard limit of 128MB, setting WP_MEMORY_LIMIT to 256MB will have no effect. This is why checking the server value first is the most important step in troubleshooting.

Proven Methods to Increase Your WordPress Memory Limit

Alright, you've figured out your current memory cap. Now for the fun part: raising it. There are a few solid ways to increase the memory limit in WordPress, but the best one for you really depends on your hosting setup. We'll start with the most common method and work our way through the others.

Before you dive in, this simple flowchart shows you exactly how to check your current limit—it's the first step you should always take before trying any of these fixes.

As you can see, you just need to pop over to your WordPress Dashboard, find the Site Health tool, and look for your PHP memory limit. Keep that number handy as a reference.

The Best Place to Start: Editing Your wp-config.php File

For most people, the quickest win is editing the wp-config.php file. This is a core WordPress file that holds all your site's base settings, making it the perfect spot to tell WordPress how much memory it's allowed to grab.

You'll find this file in the root directory of your WordPress installation. To get to it, you’ll need an FTP client like FileZilla or the File Manager tool in your hosting control panel.

Once you have the file open, scroll down toward the bottom. Right before the line that says /* That's all, stop editing! Happy publishing. */, add this little snippet of code:

define( 'WP_MEMORY_LIMIT', '256M' );

This single line tells WordPress to set its memory limit to 256MB. If you’re running something more resource-heavy, like a complex Divi or WooCommerce site, you might want to bump that up to 512M. After adding the code, just save the file and re-upload it to your server.

Pro Tip: WordPress actually has a separate memory limit for backend tasks called WP_MAX_MEMORY_LIMIT, which defaults to 256MB. If you're doing heavy lifting in the admin area, like bulk-importing products, you can add define( 'WP_MAX_MEMORY_LIMIT', '512M' ); to give your dashboard some extra juice without impacting the front-end limit.

Using the .htaccess File as an Alternative

If tweaking wp-config.php didn't do the trick, your next best bet is the .htaccess file. This is another configuration file sitting in your root directory, and it's used to control server settings, mainly for those running on an Apache server.

A word of caution: be extra careful here. A tiny mistake in .htaccess can bring your whole site down. Always, always make a backup before you start editing.

Open the .htaccess file and add the following line at the very end:

php_value memory_limit 256M

This command tries to override the server's default PHP memory limit. Save it and check your site. If you're greeted with a "500 Internal Server Error," it means your host has locked this method down. No worries—just remove the line you added, save the file again, and your site will be back to normal.

Modify Your php.ini File for Global Changes

The php.ini file is the master configuration file for PHP itself. Any change you make here will affect all PHP scripts on your server, not just WordPress. It's a powerful approach, but access is often restricted, especially on shared hosting plans.

You might find a php.ini file in your root directory. If you do, great—you can edit it. If not, you may be able to create one from scratch.

Inside the file, look for a line that starts with memory_limit. If it's there, just change the value. If not, add this line anywhere:

memory_limit = 256M

Whether this works depends entirely on your hosting provider. If you're on a VPS or dedicated server, this is usually the most reliable way. On shared hosting, it’s a bit of a gamble; the host might just ignore it.

Adjusting Limits Through Your Hosting Control Panel

Looking for an easier, code-free solution? Many hosting providers let you change PHP settings directly from your control panel. Honestly, this is often the safest and simplest way to increase your WordPress memory limit.

The exact location varies, but here’s where to start looking in popular panels:

  • cPanel: Look for an icon called "MultiPHP INI Editor" or "Select PHP Version." From there, you'll see a list of PHP settings, including memory_limit, which you can edit directly.
  • Plesk: Go to "PHP Settings" for your domain. You should see a field for memory_limit where you can type in a new value.
  • Custom Panels: Hosts like Kinsta, WP Engine, and SiteGround have their own dashboards. Poke around for a section related to PHP configuration or software settings.

This is my go-to recommendation for anyone who isn't comfortable digging into code via FTP. It’s user-friendly and you can’t really mess it up with a syntax error.

For example, in cPanel's MultiPHP INI Editor, you just select your domain, find the memory_limit setting, and change it to 256M or 512M. The change takes effect instantly.

After you've made your change using any of these methods, always head back to Tools > Site Health > Info in WordPress to confirm the new limit is active.

WordPress Memory Limit Increase Methods Compared

To help you decide which path to take, here’s a quick rundown of the different methods, what they’re good for, and how much they depend on your host.

Method Where to Apply Typical Use Case Hosting Dependency
wp-config.php Root directory Best first step; directly tells WordPress its limit. Low; usually works unless host sets a hard cap.
.htaccess Root directory Good alternative if wp-config fails on Apache servers. Medium; often disabled by shared hosts.
php.ini Root directory Powerful server-wide change, best for VPS/dedicated. High; frequently restricted on shared hosting.
Hosting Panel cPanel, Plesk, etc. Easiest and safest method for non-developers. High; depends entirely on your host providing the option.

Ultimately, starting with wp-config.php and then moving to your hosting panel are the two most reliable options for the average user.

Sometimes, the simplest solution is just upgrading your hosting plan, which makes it critical to understand how to choose a web hosting provider that fits your site's demands. For Divi users, finding a host that’s truly optimized for performance is key; our guide on the best WordPress hosting sites for 2024 has some solid recommendations.

Memory Requirements for Divi and WooCommerce Sites

Digital devices showing web content, a desktop monitor highlighting 'High Memory Sites' on a purple banner.

Let’s get one thing straight: not all WordPress sites are built the same, especially when it comes to memory. If you're running Divi or WooCommerce, treating your site like a simple blog is a surefire way to run into performance issues and the dreaded "fatal error" screen.

These powerful tools transform WordPress, but that transformation comes at a cost. Divi's visual builder, for instance, is constantly juggling modules, scripts, and styles to give you that real-time design experience. Every slider, form, and dynamic element needs its own piece of memory to function. Throw in a plugin like Divi Areas Pro for popups, and you're adding even more processes that need resources.

It all scales with complexity. A basic Divi portfolio might get by on a lower limit, but a big corporate site with custom headers, global modules, and a dozen third-party plugins is going to hit that memory ceiling fast.

Why WooCommerce Has a Big Appetite for Memory

WooCommerce is in a league of its own. An e-commerce store is a living, breathing application. It’s not just serving up blog posts; it's managing inventory, talking to payment gateways, calculating shipping costs, and handling user accounts—often all at once.

You’ll see memory usage spike during critical moments:

  • Processing Orders: When a customer hits "buy," WooCommerce is firing on all cylinders, querying the database and updating stock levels. These are all memory-hungry tasks.
  • Managing Products: Ever tried to bulk-edit a few thousand products or import a massive CSV file? That can gobble up your memory limit in seconds.
  • High Traffic Events: A Black Friday sale can bring a massive wave of shoppers. Each active cart and checkout process multiplies the memory demand, pushing your server to its limits.

The numbers don't lie. Media-heavy sites, especially e-commerce stores, can see memory usage jump by 200-300% during peak times. Specifically, WooCommerce sites with over 100 products often need 256MB to 512MB just for normal day-to-day operations. During a big sale, that can easily soar to 1GB or more. This is exactly why you need to increase the memory limit in WordPress proactively, not after your store has already crashed.

Real-World Memory Recommendations

So, how much memory do you actually need? The default server settings are almost never enough for a modern Divi or WooCommerce site. It's time to stop guessing and start with some realistic baselines.

My rule of thumb is to start with a generous limit and monitor usage. Don't start low and wait for errors to tell you it's not enough. Proactive management is the key to preventing downtime.

Here are my go-to recommendations based on countless projects I've worked on:

Site Type Description Recommended Memory Limit
Standard Divi Site A portfolio or small business site with standard modules and fewer than 10 plugins. 128MB – 256MB
Complex Divi Site A large site using many dynamic modules, third-party plugins (like Divi Areas Pro), and custom code. 256MB – 512MB
Small WooCommerce Store A store with under 500 products, a few key plugins, and moderate traffic. 256MB – 512MB
Large WooCommerce Store A store with thousands of products, numerous extensions, and high concurrent traffic. 512MB – 1GB (or more)

Treat these as starting points. If your store runs plugins for subscriptions, memberships, or complex shipping rules, aim for the higher end of the range. For Divi builders, it's also a good idea to check the official minimum requirements, as they provide a solid foundation.

And one last tip: after you make any changes, always pop over to the Site Health tool in WordPress to confirm your new, higher limit has actually been applied.

Troubleshooting When Your Fix Does Not Work

You've carefully edited your wp-config.php file, hit save, and rushed over to the Site Health tool—only to find the memory limit hasn't budged. It’s a common and incredibly frustrating roadblock.

When your attempts to increase the memory limit in WordPress seem to go nowhere, it's almost always because a server-level setting is overriding your changes.

Think of it this way: your WordPress wp-config.php file is making a request for more memory, but your hosting server has the final say. If the server has a hard cap of 128MB, WordPress can't grab 256MB, no matter how nicely you ask in the code.

This happens all the time on shared hosting plans where resources are tightly controlled to keep things stable for everyone on the server. The hosting provider sets a global PHP memory limit that simply can't be exceeded by your site's local configuration.

What to Do When Your Hosting Provider Is the Bottleneck

If you suspect your host is blocking your changes, the most direct path forward is to contact their support team. Don't just send a message saying "my site is broken." Be specific, clear, and give them the information they need to help you quickly. A well-phrased request can turn a multi-day headache into a ten-minute fix.

Here’s a script you can adapt when reaching out to your hosting support:

Subject: Request to Increase PHP Memory Limit for My Domain

Hi Support Team,

I am running a WordPress site on the domain [YourDomain.com] and have been encountering "Allowed memory size exhausted" errors. I've already tried to increase the memory limit to 256M by defining WP_MEMORY_LIMIT in my wp-config.php file, but the change isn't taking effect, as confirmed in my WordPress Site Health tool.

Could you please increase the server-side memory_limit for my account to 256M (or 512M if possible)? My theme and plugins require this to run smoothly.

Thank you for your help!

This approach shows them you've already done your homework, which usually gets you a much faster resolution. Most reputable hosts will happily adjust this for you, especially if you're on a managed WordPress plan.

When the Limit Increases but Errors Persist

So, what if the opposite happens? You successfully increase the memory limit—Site Health confirms it's at a healthy 512MB—but you're still getting fatal memory errors. This is a classic sign that the problem isn't the memory cap itself, but something consuming memory uncontrollably.

In these situations, the true culprit is often a rogue plugin or a theme conflict. A poorly coded plugin can create a "memory leak," where it continuously uses up memory without releasing it, eventually exhausting even a generous limit. It's like a leaky bucket; adding more water won't fix the hole.

To diagnose this, you'll need to systematically isolate the problem. This process will temporarily affect your site's appearance and functionality, so it's best to do this during a low-traffic period or on a staging site if you have one.

Here’s a clear roadmap for debugging:

  1. Switch to a Default Theme: First, temporarily activate a default WordPress theme like "Twenty Twenty-Four." If the error vanishes, the issue lies within your primary theme.
  2. Deactivate All Plugins: If changing the theme didn't help, deactivate all of your plugins at once. If the error is gone, you now know for sure that a plugin is to blame.
  3. Reactivate One by One: Now, start reactivating your plugins one at a time, checking your site after each activation. When the error comes back, you've found your problematic plugin.

Once you identify the source—whether it's a theme or a plugin—you can check for an update, contact its developer for support, or find a more efficient alternative. This methodical process helps you find the root cause instead of just throwing more memory at the problem.

Understanding the broader picture of your site's resource usage is a key part of overall server performance optimization, helping you build a more stable and reliable website.

Common Questions About WordPress Memory

As you've been working through the steps to increase the memory limit in WordPress, you've probably had a few questions pop into your head. Let's tackle the most common ones I hear from clients and community members to clear up any lingering confusion.

What’s a Good Memory Limit to Set?

There’s no magic number here; the right memory limit really depends on what your site is doing. A simple blog or a basic portfolio site can run just fine on 128MB. It's a solid, safe starting point that gives your theme and a few key plugins enough room to breathe.

But the moment you start adding heavier tools, that number has to go up.

  • A complex Divi site loaded with dynamic content and multiple plugins? You should be starting at 256MB, minimum.
  • Running a small WooCommerce store? I always recommend 256MB to get started, but you'll be much safer with 512MB to keep checkouts and inventory updates running smoothly.
  • For big e-commerce sites or sprawling multisite networks, you’re looking at 512MB to 1GB, or sometimes even more, depending on your traffic and the number of extensions you're running.

My advice? Be a little generous. It's always better to allocate slightly more memory than you think you need rather than finding out you don't have enough when your site crashes during a traffic spike.

Will Increasing My Memory Limit Slow Down My Site?

This is a really common myth, but the answer is a hard no. In fact, it's the opposite. Bumping up an inadequate memory limit will almost always make your site faster and more reliable.

Think of it like an engine. A low memory limit is like trying to run on fumes—it's going to sputter, perform poorly, and eventually stall out completely.

When your site has enough memory, PHP scripts can run without hitting that frustrating ceiling. That translates to faster page loads, a smoother experience in the admin dashboard, and far fewer timeout errors. You're not adding overhead; you're simply removing a bottleneck that was slowing you down.

How Does My Hosting Choice Affect the Memory Limit?

This is the big one. Your hosting provider ultimately has the final say on your memory limit. You can tweak your wp-config.php file until you're blue in the face, but if your host has a hard cap at the server level, your edits won't do a thing. This is, by far, the most common reason people get stuck.

Here’s a quick breakdown of what to expect from different hosting types:

  • Shared Hosting: This is usually the most restrictive environment. To keep things fair for everyone on the server, hosts often lock memory limits at a low number, like 64MB or 128MB. You’ll almost always have to contact their support team to ask for an increase.
  • Managed WordPress Hosting: These guys get it. They understand what modern WordPress sites need and typically offer higher default limits. More importantly, they often give you an easy-to-use control panel to adjust the memory yourself.
  • VPS and Dedicated Servers: Here, you’re in the driver's seat. You have full control and can set the memory limit to whatever your site demands directly in the main php.ini file. This gives you the most freedom for high-traffic or resource-heavy websites.

Bottom line: your hosting plan defines your ceiling. If you’re constantly hitting memory errors and your host can’t or won’t raise the limit, it’s a crystal-clear sign that you’ve outgrown your current plan.


At Divimode, we build tools that empower you to create high-performing, engaging websites with Divi. Our flagship plugin, Divi Areas Pro, gives you the power to build advanced popups, fly-ins, and dynamic content that converts. Check out Divimode to see how you can elevate your Divi site today.