Your site goes blank, and in place of your homepage WordPress prints an alarming message: “Allowed memory size exhausted.” Don’t panic — your website isn’t broken. PHP, the language WordPress is built on, has simply hit the memory ceiling your server allows it.
In a nutshell, this error means your server isn’t allocating enough resources for WordPress to execute the PHP scripts it needs to function properly. This issue can negatively affect your site’s functionality, but there are several ways you can fix and even prevent it.
The fix: increase your PHP memory limit. Connect to your site via SFTP, open the wp-config.php file in your WordPress root folder, and add define( 'WP_MEMORY_LIMIT', '256M' ); on its own line above /* That's all, stop editing! Happy publishing. */. If the error persists, your host’s server-level memory_limit is the cap — ask your host to raise it. Below, we’ll walk through every method step by step, starting with how to recognize the error.
Why you’re seeing a WordPress memory limit error on your site
As we mentioned earlier, the PHP memory limit error means you’re not allocating enough resources for your WordPress installation to function correctly. The problem usually presents itself with a message such as:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2348617 bytes)
That message is more useful than it looks. The byte figure is your current memory limit — divide it by 1,048,576 to convert to megabytes, so “134217728 bytes” means a 128 MB limit. The message also names the file that ran out of memory, and its path usually points straight at the plugin or theme responsible. One warning: if the same plugin keeps exhausting memory no matter how high you set the limit, raising it further just masks a memory leak. Update, replace, or remove the culprit instead.
Don’t be scared by the word “fatal,” though. In PHP, a fatal error just means the one script that ran out of memory stopped running: your files and your database are untouched. You will need to make a small configuration change to keep it from happening again — specifically, raising your PHP memory limit.
Can’t even reach your dashboard? That’s common with this error: a memory-exhausted fatal error can take down wp-admin along with the rest of your site. The good news is that every file fix in this guide works over SFTP, no login required. And if a specific plugin caused the crash, you can disable it over SFTP too — open wp-content/plugins and rename that plugin’s folder to switch it off.
What actually uses up your PHP memory
The limit is just a ceiling; something on your site has to hit it. The usual suspects: heavy plugins (WooCommerce, for example, loads product, customer, and payment logic on every request, and that work takes real memory), bloated multipurpose themes that ship dozens of features you never use, poorly coded plugins with memory leaks, two plugins conflicting with each other, and big one-off jobs like image regeneration or site backups. To find your culprit, start with the file path in the error message. If you host with DreamHost, the panel’s AI-powered error log analysis can also read the raw log for you and suggest a fix. Raising the limit cures the symptom; a leaky plugin will keep crashing your site until you update, replace, or remove it.
WP_MEMORY_LIMIT vs. the server’s PHP memory_limit
By “PHP memory limit,” we mean the amount of server memory that’s allocated to run PHP scripts — but there are actually two separate values in play, and knowing the difference explains why some fixes seem not to work.
- WP_MEMORY_LIMIT is WordPress’ own setting, declared in wp-config.php. By default, WordPress sets it to 40 MB for a single site and 64 MB for a multisite installation, and allows admin-area tasks up to 256 MB through a second constant, WP_MAX_MEMORY_LIMIT.
- memory_limit is the server-level PHP setting, controlled through php.ini (on DreamHost, a phprc file). This one is the hard cap: whatever wp-config.php declares, WordPress can never use more memory than the server allows.
Here’s why that matters: the fatal error above reports a server allowing 134217728 bytes (a 128 MB cap). Add define( 'WP_MEMORY_LIMIT', '256M' ); on that server and WordPress still tops out at 128 MB, and the error keeps printing the same number until the server-level value rises. When the wp-config.php edit below doesn’t seem to change anything, the server cap is usually why — and that’s what methods 2 through 4 are for.
How to check your WordPress memory limit
To check your WordPress memory limit, access your WordPress dashboard and navigate to Tools > Site Health > Info. Next, expand the Server section and look for the PHP memory limit entry.
Within the Server section, you can also check other information such as your PHP version and the PHP time limit. The latter variable, which is in seconds, defines how long PHP scripts have to execute before they time out.
For now, let’s focus on the PHP memory limit. As you can see, the above example has quite a high limit, which means that the website is unlikely to run into a WordPress Memory Exhausted error.
If your site has a low memory limit (<64 MB), it’s in your best interests to increase it. There are several ways you can do so.
How to resolve the WordPress memory limit error (5 methods)
As far as WordPress errors go, this one has a clear-cut cause and solution. PHP is hitting its memory ceiling, so you need to raise it. In this section, we’ll go over five methods, ordered from the safest do-it-yourself fix to the options your host handles for you — most of them free.
1. Increase your WordPress memory limit manually (edit wp-config.php)
The classic fix is to declare a higher allowed memory size in your site’s wp-config.php file. It’s the safest of the file edits, and it’s easy to do. All you need is a Secure File Transfer Protocol (SFTP) client such as FileZilla that you can use to connect to your website.
One quick safety step first: back up your site, or at minimum download a copy of wp-config.php to your computer before you edit it. A single typo in this file can take your whole site offline, and a saved copy lets you roll back in seconds.
Once you access your website via SFTP, open the WordPress root folder and look for the wp-config.php file within it.
Open that file using a text editor, and you should see something like this:
To increase your PHP memory limit, you can simply add a single line of code anywhere after the <?php tag and before the part of the file that reads “/* That’s all, stop editing! Happy publishing. */”.
This is the line of code to add:
define( 'WP_MEMORY_LIMIT', 'XXXM' );
You’ll need to replace the “XXX” variable within that line with the amount of memory you want to allocate to PHP. As we mentioned before, 64 MB is a sensible minimum to raise it to.
However, you can also double the number to play it safe or increase it even further. For example, if you set a PHP memory limit of 256 MB, it would look like this:
define( 'WP_MEMORY_LIMIT', '256M' );
Once you’re set on a number, save the changes to wp-config.php and close the editor. Now return to your WordPress dashboard, navigate to Tools > Site Health > Info, and expand the Server section to see if the changes went through.
If the value didn’t change, don’t assume you typed something wrong. Sometimes you won’t have the file permissions needed to make the edit stick — but far more often, the server’s memory_limit is capping whatever wp-config.php declares. That’s what the next methods are for.
2. Raise the server’s PHP memory limit (php.ini or phprc)
To raise the server-level cap itself, edit the memory_limit directive in your PHP configuration file. Depending on your host, that’s a php.ini file, a .user.ini file, or — at DreamHost — a phprc file. Open it over SFTP and add (or update) this line:
memory_limit = 256M
Save the file, and the new limit applies to every PHP script on the site, WordPress included. Not every host exposes this file to customers, though. If you can’t find or create one, jump to method 4 and ask your host’s support team instead.
How to increase the PHP memory limit on DreamHost
On DreamHost, you raise memory_limit by adding the line above to a phprc file, which overrides the default PHP settings for your domain. On DreamPress, use a .user.ini file instead. DreamHost’s Knowledge Base article on increasing the PHP memory limit walks through creating the file via FTP or SSH and confirming the new value took effect.
3. Set the memory limit in .htaccess (only on some hosts)
If you can’t edit a php.ini-style file, some servers let you set PHP values from your site’s .htaccess file instead, by adding:
php_value memory_limit 256M
Two caveats before you try it. First, this only works where the server runs PHP as an Apache module — many hosts don’t, and on DreamHost specifically, PHP settings must go in a phprc file, not .htaccess. Second, .htaccess governs how your site interacts with your server, so a typo here can cause site-wide errors. Save a copy first, and if you see a 500 error after editing, remove the line.
4. Ask your web host to raise the limit
If file editing isn’t your thing, or your edits keep getting overridden, ask your provider’s support team to raise the PHP memory limit on their end. Asking costs nothing, with one honest caveat: support may confirm that your current plan’s cap is as high as it goes — that’s when method 5 comes in.
DreamHost customers can open a live chat or a ticket with the in-house support team from the DreamHost panel, 24/7. A short, specific request works best. For example: “My site at example.com is hitting ‘Allowed memory size exhausted’ errors. Can you raise the PHP memory_limit for my account, or tell me the maximum my current plan allows?”
5. Upgrade your website’s hosting plan
Typically, if you use a decent WordPress hosting provider, you won’t need to worry about increasing your PHP memory limit. One caveat is that if you’re using shared hosting, you’ll likely face limited resources. So when your host confirms that your account or plan cap is the constraint — and only then — upgrading your hosting package is the fix that actually moves the ceiling.
Before you pay, rule out the cheaper causes: a leaking or conflicting plugin will exhaust any limit eventually, and method 4 costs nothing to try. If the cap really is the constraint, the only limiting factor is your budget.
And if your current provider can’t help at all, it might be time to switch to a better WordPress host whose plans are sized for the traffic your site actually gets.
How to verify your new memory limit
Whichever method you used, confirm it worked: head back to Tools > Site Health > Info, expand the Server section, and check the PHP memory limit value. If it shows your new number, you’re done. If it doesn’t, a host-enforced cap is overriding your edit — that’s your cue to go back to method 4 and ask your host to raise it for you.

Skip the Stress
Avoid troubleshooting when you sign up for DreamPress. Our friendly WordPress experts are available 24/7 to help solve website problems — big or small.
Check Out PlansFAQs about the WordPress memory limit
What is the WordPress memory limit?
The WordPress memory limit (WP_MEMORY_LIMIT) is the maximum amount of server memory WordPress will try to use to run PHP scripts. By default, WordPress sets it to 40 MB for a single site and 64 MB for multisite. You can raise it in wp-config.php.
How do I check my WordPress memory limit?
In your WordPress dashboard, go to Tools > Site Health > Info, expand the Server section, and read the PHP memory limit entry. That figure is the limit your server currently allows PHP scripts to use.
What’s the difference between WP_MEMORY_LIMIT and the PHP memory_limit?
WP_MEMORY_LIMIT is WordPress’ own setting, declared in wp-config.php. The PHP memory_limit is the server-level cap, set in php.ini (or a phprc file on DreamHost). The server cap always wins — WordPress can’t use more memory than the server allows.
What does “Allowed memory size exhausted” mean?
It means a PHP script — usually a plugin or theme — needed more memory than your server allows. The byte figure in the message is your current limit: 134217728 bytes equals 128 MB. Raise the memory limit, or replace the plugin that keeps exhausting it.
How do I increase the PHP memory limit on DreamHost?
Add memory_limit = 256M to a phprc file (on DreamPress, use a .user.ini file instead). DreamHost’s Knowledge Base article on increasing the PHP memory limit covers creating the file via FTP or SSH.
Want more WordPress error tips?
Once you increase PHP memory on your WordPress website, we can help tackle other issues. We’ve put together several tutorials to help you troubleshoot every error message:
- How to Fix Common WordPress Errors
- How to Troubleshoot the WordPress White Screen of Death (WSoD)
- How to Fix the 500 Internal Server Error in WordPress
- How to Fix Syntax Errors in WordPress
- How to Fix the WordPress Not Sending Email Issue
- How to Fix the Error Establishing Database Connection in WordPress
- How to Fix WordPress Error 404 Not Found
- How to Fix White Text and Missing Buttons in WordPress Visual Editor
- How to Fix the Sidebar Below Content Error in WordPress (In 3 Steps)
- What to Do When You’re Locked Out of the WordPress Admin Area
- How to Fix the WordPress Login Page Refreshing and Redirecting Issue
Want more information on WordPress site management? Check out our WordPress Tutorials, a collection of guides designed to help you navigate the WordPress dashboard like an expert.
Increasing the PHP memory limit
Running into a PHP fatal error can be worrying, but it’s not necessarily a cause for concern. Learning how to increase your PHP memory limit is relatively simple if you don’t mind using an SFTP client and adding a single line of code to one of WordPress’ core files.
The alternative is to ask your host to raise the server-level limit, and to upgrade only if they confirm your plan’s cap is the constraint. A higher cap makes the error far less likely to come back, but it won’t fix a leaking or poorly coded plugin — identify the culprit before paying for more resources.
If you’re ready to use a web host optimized for WordPress websites, check out our DreamPress plans! We offer optimized WordPress setups, so you spend less time troubleshooting errors and more time working on your website.
Did you enjoy this article?
