Ever seen that dreaded "Allowed memory size exhausted" error flash across your screen? You’re not alone. I’ve seen it countless times, and honestly, it’s a common growing pain for any successful WordPress site. When your site starts getting more complex with powerful plugins, beautiful high-res images, and a steady stream of traffic, a quick wordpress memory limit increase is often the next logical step. Fixing this isn't just about getting rid of an error—it's about making sure your site stays stable and fast as it grows.
Why Your WordPress Site Is Running Out of Memory
That alarming "fatal error" message doesn't mean you've done something wrong. On the contrary, it usually means your website is doing something right. It's attracting more visitors, running sophisticated features, or handling more data than the default settings can cope with.
Think of your website's memory like the RAM in your computer. It’s the short-term workspace that PHP (the language WordPress runs on) uses to juggle all the tasks that bring your site to life.
Every plugin you install, every slick image you upload, and every visitor who lands on a page needs a small piece of that memory. When all those requests pile up at once, they can push past the allocated limit, forcing the server to shut things down to prevent a bigger crash. It's an abrupt but necessary safety measure.
Understanding the PHP Memory Limit
By default, WordPress tries to set its own memory limit of 40MB for a standard site and 64MB for a multisite network. In today's web, that's barely enough to get by. Most modern hosting environments and feature-rich websites find this amount laughably small.
Take a complex e-commerce store running WooCommerce, for example. During a big flash sale, it could easily crash if the memory limit is too low. Think about it: you've got payment processing, inventory updates, and dynamic content being served to hundreds of users all at the same time. Those are incredibly memory-hungry tasks.
The problem is so widespread that getting a handle on memory management has become an essential skill. This is especially true when you consider that WordPress now powers over 43% of all websites on the internet. In fact, data from 2023 showed a staggering 65% of WordPress users had to increase their PHP memory limits, with many jumping to 256MB or 512MB just to keep things running smoothly. You can discover more insights about these WordPress memory limit statistics and see how your site stacks up.
A low memory limit is like trying to run a modern operating system on a computer from the '90s. It might technically work for basic tasks, but the moment you ask it to do anything complex, the system will inevitably crash.
Before you start raising the limit, it’s helpful to know why you're running out of memory in the first place. It’s usually a mix of a few key things:
- Resource-Heavy Plugins: Tools for e-commerce, page builders like Elementor, or complex backup plugins are notorious memory hogs.
- High Traffic Volume: More simultaneous users mean more simultaneous processes, and each one eats up a slice of memory.
- Complex Themes: Modern themes packed with advanced features and dynamic elements often need more resources than simpler designs.
A great first step is figuring out what a reasonable memory limit is for your specific type of website. Not every site needs a massive 512MB of memory, and setting it too high can sometimes mask underlying performance issues.
Here's a quick guide to help you gauge where you should be aiming.
Common Memory Limit Scenarios and Recommended Actions
| Site Type | Common Symptoms | Recommended Memory Limit |
|---|---|---|
| Personal Blog / Portfolio | Occasional "memory exhausted" errors when uploading large images or installing new plugins. | 128MB |
| Small Business Website | Slowness in the admin dashboard, errors when running page builders or multiple plugins. | 256MB |
| E-commerce Store (WooCommerce) | Site crashes during checkout, slow product filtering, errors during sales or high traffic periods. | 256MB – 512MB |
| Membership / LMS Site | Errors when multiple users are logged in, taking courses, or accessing protected content. | 512MB |
| Multisite Network | Widespread performance issues across the network, especially if sites use heavy plugins. | 512MB or higher |
This table should give you a solid baseline. For a simple blog, 128MB is often plenty. But if you’re running a bustling online store or a membership site, you’ll want to aim for 256MB at a minimum, and more likely 512MB, to ensure a smooth experience for your customers.
Editing Your Wp-config.php File the Right Way
One of the most direct ways to give your WordPress site a memory limit increase is by editing the wp-config.php file. Think of this as one of the main control panels for your website. It's a core file that holds your base configuration details, and you'll find it sitting in the root directory of your WordPress installation—usually a folder named public_html.
To get to it, you can use an FTP client like FileZilla or just pop into the File Manager inside your hosting control panel. But before you touch a single line of code, you absolutely must create a backup of this file. I can't stress this enough. One tiny typo can bring your entire site down. Having a backup on hand means you can fix it in seconds.
Locating and Modifying the File
Once you’ve got the wp-config.php file open in a text editor, your job is to add one specific line of code. Scroll down toward the bottom of the file until you see this comment:
/* That's all, stop editing! Happy publishing. */
You’ll want to paste the new code snippet on its own line right before that comment. Placing it here ensures WordPress reads the new rule correctly without messing with any other essential settings. I remember the first time I fixed a client’s crashing site this way; the relief of seeing it pop back online after adding just a single line of code was immediate.
The most common reason people do this is to fix the dreaded "Allowed memory size exhausted" fatal error. To solve it, you can add a line like define('WP_MEMORY_LIMIT', '512M'); which bumps the limit up to 512MB. This is a pretty common recommendation for more complex sites loaded with plugins. You can discover more insights about resolving memory errors and see why this is such a go-to method.
The screenshot below gives you a look inside a typical wp-config.php file, showing where different definitions live.

This just helps visualize where your custom code—like the memory limit line—should go within the file's structure.
Choosing the Right Memory Limit Value
So, what should you actually add? For most small business websites or blogs, starting with 256MB is a safe bet.
define('WP_MEMORY_LIMIT', '256M');
Just paste that line into your wp-config.php file, save the changes, and upload it back to your server, overwriting the original. If you're running a heavy-duty e-commerce store or a site with a learning management system, you might need something higher, like 512M.
Important Takeaway: Just because you set a value here doesn't mean it's a guarantee. Your web host can set a server-level cap that overrides whatever you put in your
wp-config.phpfile. If your changes don't seem to have any effect, this is almost always the reason why.
It's also really important to know the difference between two very similar-looking definitions:
WP_MEMORY_LIMIT: This one sets the memory limit for the front end of your website—what your visitors actually interact with.WP_MAX_MEMORY_LIMIT: This one controls the memory available for the WordPress admin dashboard. This is a lifesaver if your backend is sluggish or crashing when you're trying to work with memory-hungry plugins or page builders.
You can even define both if you need to, making sure the experience is smooth for both you and your users.
What To Do When Wp-config Isn't Enough
So you’ve edited your wp-config.php file perfectly, hit refresh, and… that infuriating “Allowed memory size exhausted” error is still staring you in the face. It’s a frustratingly common scenario I’ve seen countless times, but it almost always points to one thing: your hosting provider has a server-level restriction that’s overriding your changes.
When this happens, you have to dig a bit deeper. We’ll walk through two more powerful ways to get that WordPress memory limit increase when the wp-config.php method falls short. This involves editing either your server’s php.ini file or the .htaccess file.

Each of these files works differently, and whether you can even use them depends entirely on your hosting setup. Figuring out which one is right for your situation is the key to finally squashing that error.
Using the Php.ini File for a Definitive Fix
The php.ini file is the master configuration file for PHP on your server. Any changes you make here are the law of the land and will override settings in other files. If you can get to it, this is by far the most reliable way to increase your memory limit.
The big hurdle, though, is access. On most shared hosting plans, you won't be able to touch this file directly because it affects every single site on that server. This method is usually for people with a VPS, a dedicated server, or specific hosting plans that grant that next level of control.
If you can track down your php.ini file (it’s often in your root directory or accessible through a tool like cPanel’s MultiPHP INI Editor), the fix is simple.
- Open up the
php.inifile. - Look for the line that starts with
memory_limit. - Change the value to what you need, like
memory_limit = 256M.
Expert Tip: Can't find a
php.inifile anywhere? Sometimes, you can create a new one in your site's root directory and just add thememory_limitline to it. This only works if your host has configured their server to look for and obey localphp.inifiles, but it's worth a shot.
Editing the .htaccess File as an Alternative
No access to php.ini? Your next best bet is the .htaccess file. This file sits in your WordPress root directory and lets you make configuration changes for just your site. It’s a great workaround, but it has one major catch: it only works on servers running Apache or a compatible alternative like LiteSpeed. This trick will do absolutely nothing on an NGINX server, which is getting more and more popular these days.
To try this method, you just need to add one line of code to the very top of your .htaccess file, right before the # BEGIN WordPress section. Be extremely careful here—one tiny typo can trigger a "500 Internal Server Error" and take your whole site offline.
Add this line to set the memory limit:
php_value memory_limit 256M
Save the file and check your site immediately. If the error is gone, you’re all set. If your site breaks, don't panic! Just go back, remove the line you added, and save the file again to bring it back online.
Remember, just raising the memory limit is often a band-aid for a deeper issue. For a long-term solution, you should look into why your site is using so much memory in the first place. Our guide on how to optimize your WordPress site is a great place to start, covering everything from image compression to database cleanup. A well-optimized site often prevents these memory headaches from ever happening.
If you're not keen on digging around in your site's code files like wp-config.php, I have good news. The absolute safest and often fastest way to get a WordPress memory limit increase is right through your hosting provider's control panel. This route completely sidesteps the risk of a typo bringing your whole site down. It's designed to be user-friendly for a reason.
Most good hosts, especially those using platforms like cPanel or Plesk, give you a graphical interface to manage your server settings. Forget manual edits; you’re looking for a tool that lets you tweak PHP values with a few simple clicks. Honestly, this is the first place I always check before trying any of the more technical solutions.
Finding the Right Tool in cPanel
In a cPanel environment, the tool you're looking for is usually called the MultiPHP INI Editor. This feature is a lifesaver, letting you modify the core php.ini configuration for your domain without needing to fire up an FTP client or learn any command-line magic.
Here's the typical path to find it:
- First, log into your hosting account's cPanel dashboard.
- Scroll down until you find a section labeled "Software."
- Look for an icon named "MultiPHP INI Editor" or something similar like "Select PHP Version."
Once you're in, you'll see a list of different PHP settings. Just scroll down until you spot memory_limit. From there, you can type in a new value like 256M or 512M and hit save. The change kicks in almost immediately and is far less prone to error than editing files by hand.
The image below gives you a good idea of what this kind of control panel interface looks like.

As you can see, it's pretty straightforward to find the memory_limit directive and give it a boost through a user-friendly panel.
Comparing Methods to Increase WordPress Memory Limit
To give you a clearer picture, let's stack up the different ways you can tackle this. Some are easier than others, and your hosting setup might limit your options. This table breaks it all down.
| Method | Ease of Use | Effectiveness | Common Availability |
|---|---|---|---|
| Hosting Control Panel | Very Easy | High | Widely available on most shared and managed hosts. |
| wp-config.php | Easy | Medium | Works unless overridden by a server-level limit. |
| php.ini | Medium | Very High | Often restricted on shared hosting plans. |
| .htaccess | Medium | Medium | Can work, but less reliable than other methods. |
| Contacting Support | Very Easy | High | The ultimate fallback; always an option. |
The takeaway here is pretty clear: starting with your hosting panel is almost always the best first step. It's the perfect blend of simplicity and power for most users.
When You Need to Contact Support
But what happens if you can't find the tool, or you make the change and it still doesn't work? This usually points to a stricter, server-wide cap that your host has put in place. I once spent an hour on a client's site trying every manual edit I knew, only to find out a hidden server limit was overriding everything. A quick five-minute chat with their support team was all it took to fix it.
Don't Underestimate Asking for Help: If you're stuck, just send a polite message to your host's support. It’s often the fastest path to a solution. They can tell you exactly what your plan's memory cap is and, more often than not, raise it for you.
Here's a simple template you can use:
Subject: Request to Increase PHP Memory Limit
Hi Support Team,
I'm running a WordPress site on the domain [YourDomain.com] and have been hitting the "Allowed memory size exhausted" error. I've tried to adjust this myself, but it seems I'm hitting a server-level limit.
Could you please increase the PHP memory_limit for my account to 256M?
Thank you for your help!
Choosing a host with great support and solid features can save you from these kinds of headaches altogether. If you feel like you're constantly bumping up against your server's limitations, it might be a sign that it's time to check out some of the best hosting options for WordPress that provide better resources and easier ways to manage your configuration.
How to Confirm Your Changes Are Working
So you've edited the files, but don't just walk away and assume the job is done. You need to actually verify that your WordPress memory limit increase was successful. Thankfully, WordPress has a built-in tool that saves you from guessing or waiting for another error to pop up.
Head over to your WordPress admin dashboard and navigate to Tools > Site Health. From there, click on the "Info" tab. This screen is a goldmine of technical details about your site's entire setup.
Find the section labeled "Server" and click to expand it. You'll see an item called "PHP memory limit" which shows the real, active value your site is currently using. If it shows your new, higher number, you're good to go!
Troubleshooting When the Limit Hasn't Changed
What if you check Site Health and the number is still stuck at the old, lower value? This is a pretty common hiccup. It usually means something is either overriding your change or preventing it from being saved correctly.
Let's walk through the usual suspects.
- Server-Level Overrides: This is the big one. Your hosting provider can set a hard cap on memory at the server level. If their limit is
128M, it doesn't matter if you set256Minwp-config.php—the server's configuration will always win. - Syntax Errors: It happens to the best of us. A simple typo, a missing semicolon, or an extra quote in the code you added can break the file. This stops WordPress from reading your new directive. Carefully double-check the code snippet for any mistakes.
- Incorrect File Permissions: Sometimes, the permissions for files like
wp-config.phpor.htaccessare set to read-only on your server. This would prevent your FTP client or file manager from actually saving the changes, even if it looked like it did.
The evolution of WordPress’s default memory limits really tells a story about the web's growth. Back in the early days, servers often only provided 16MB or 32MB of PHP memory. Fast forward to today, and recommendations for 256MB are standard, with high-performance sites often pushing to 512MB or even 1GB. Learn more about the historical context of memory limits and why today's needs are so much greater.
If you've confirmed your edits are perfect and that number still won't budge, the issue is almost certainly a server-level restriction. At this point, the quickest solution is to reach out to your hosting provider's support team. They can confirm their limit and often increase it for you.
One final thing to try is clearing your caches. While a memory limit change is a server-side setting, caching layers can sometimes serve stale information. After making any significant change to your site's backend, it's always good practice to flush all your caches.
To make sure everything is fresh, you can follow this straightforward guide on how to clear your WordPress cache properly. This simple step can often resolve confusing issues and confirm your changes are live.
Questions We Hear All the Time About Memory Limits
When you're trying to increase your WordPress memory limit, a few common questions always seem to pop up. Even after you've tinkered with the files, you might still be wondering about the "right" way to do things or why your changes aren't sticking. Let's tackle some of the queries we get the most.
What’s the Ideal WordPress Memory Limit?
Honestly, there's no single magic number that works for everyone. But a solid rule of thumb for most modern websites is 256MB. This gives you a comfortable cushion, especially if you're running a page builder, an e-commerce plugin like WooCommerce, or a handful of other hungry tools.
If you're just running a simple blog, 128MB could be perfectly fine. On the flip side, for a sprawling e-commerce store, a busy membership site, or a multisite network, you should probably aim for 512MB or even higher. It’s a smart move to keep things stable, especially when traffic spikes.
A quick heads-up: cranking the limit to something excessive like
2048Mwon't magically speed up your site. In fact, it can sometimes hide bigger problems, like a poorly coded plugin that's secretly leaking memory. The goal here is to provide enough resources, not an infinite supply.
Why Didn't My Changes Work?
It's frustrating, I know. You've edited the files, hit save, and… nothing. The memory limit is exactly the same. The most common culprit? Your hosting provider has put a server-level restriction in place. Many shared hosts cap the memory limit to keep resources balanced for everyone, and their server settings will always win.
A few other things could be tripping you up:
- Syntax Errors: A tiny typo, like a missing semicolon in
wp-config.phpor a misplaced character in your.htaccessfile, can make the entire command invalid. - Wrong File or Location: You might be editing a file in the wrong directory or pasting the code snippet in a place where it won't be executed correctly.
- Server Type: Remember that the
.htaccessmethod is an Apache-specific trick. If your host runs on an NGINX server, that file is completely ignored, so the changes won't do a thing.
Is It Safe to Increase the Memory Limit?
Yep, absolutely. Increasing the memory limit is a standard, safe troubleshooting step, as long as you're careful. The biggest risk is making a syntax error while editing a core file like wp-config.php, which can cause the dreaded "white screen of death" and take your site offline temporarily.
To keep that from happening, just follow a few best practices:
- Always Backup First: Before you touch a single line of code in your core files, make a full backup of your website. No exceptions.
- Use a Staging Site: If you have one, test any major changes in a staging environment first. It’s the perfect sandbox to break things without affecting your live site.
- Start Low: Don't jump straight to the maximum allowed limit. Start with a modest increase—say, from 128M to 256M—and see if that solves the problem.
By taking a careful approach, you can fix those annoying memory errors and get your site running smoothly without creating any new headaches.
Ready to build visually stunning websites without ever worrying about code? Exclusive Addons for Elementor provides over 108 powerful widgets and extensions, including dynamic post displays and advanced e-commerce tools, all optimized for lightweight performance. Elevate your Elementor experience today with Exclusive Addons!