How to Increase the WordPress PHP Memory Limit (Step-by-Step Guide)
Introduction

If you’ve run into the “Allowed memory size exhausted” error while updating a plugin, uploading an image, or editing a page with a builder like Elementor, you’re hitting the WordPress PHP memory limit. This guide explains what that actually means and shows you how to increase your WordPress PHP memory limit so you can move past it. I’ll walk through the practical methods, common mistakes, and when it might be time to get help. This is written for site owners who prefer to fix things themselves and developers who need a straightforward reference.

What Is the WordPress PHP Memory Limit and Why Does It Matter?
PHP is the programming language WordPress runs on. The memory limit is the maximum amount of server RAM a single PHP script on your site can consume. Think of it like a bucket. If your theme, plugin, or page builder needs more memory than the bucket holds, it overflows. That overflow shows up as the white screen of death or the memory exhausted error.
This matters because modern WordPress sites tend to use more resources. Page builders, heavy plugins like WooCommerce or membership systems, and media galleries all demand more memory than a basic text blog. A low limit means you can’t do routine tasks like upload a large image or save a change in your page builder without hitting a wall. Knowing this limit helps you diagnose problems before they take your site down.
How to Check Your Current WordPress PHP Memory Limit
Before changing anything, check what you’re working with. The easiest way is through the WordPress admin area. Go to Tools > Site Health > Info and scroll down to the “Server” section. You’ll see a line called “PHP memory limit” that shows the current value. It’s usually something like 40M, 64M, or 128M.
If you want a deeper look, you can create a simple PHP info file. Or install a security plugin and use its server info tool instead. The point is to know your starting point. A common default on shared hosting is 64MB, which is often too low for even a moderately active business site.
Recommended PHP Memory Limit Values for Different Sites
Not every site needs the same allocation. Here’s a practical guide based on what I’ve seen work across many WordPress installations:
- 64MB: Fine for a simple blog with minimal plugins and no page builder. Don’t run WooCommerce on this.
- 128MB: Good for most business sites with a lightweight theme, some plugins, and a builder like Gutenberg or Kadence Blocks.
- 256MB: Recommended for sites using Elementor, Divi, or similar builders, plus modest ecommerce. This is the sweet spot for most serious sites.
- 512MB: For WooCommerce stores with many products, membership sites, or multisite networks. Only go this high if you’re sure your host supports it.
- 1GB+: Reserved for high-traffic sites or those with custom applications running complex queries. Rarely needed for standard WordPress.
I’d start at 256MB for any site that uses a page builder or has more than a dozen active plugins. If the site is simple and fast, 128MB is safe. Anything below 128MB is asking for trouble with modern WordPress.
Method 1: Increase Memory Limit via wp-config.php File
This is the most reliable method. You only need to edit one file: wp-config.php, located in your WordPress root folder.
Access your site via FTP (FileZilla works well) or your hosting file manager. Open wp-config.php and look for the line that says:
/* That's all, stop editing! Happy publishing. */
Right above that line, add this:
define('WP_MEMORY_LIMIT', '256M');
You can replace 256M with 128M or 512M as needed. Save the file and close it. The change takes effect immediately for most sites.
A few things to get right: use single quotes exactly as shown, leave the semicolon at the end, and make sure the line is inserted before the “That’s all” comment. Inserting it after that comment will break the file. Also, this only affects the WordPress admin panel. To raise the limit for front-end requests too, you would use define('WP_MAX_MEMORY_LIMIT', '256M'); instead or in addition. For most users, the first method is enough.

Method 2: Increase Memory Limit via cPanel or Hosting Panel
If editing core files feels risky, you can often adjust the limit through your hosting control panel. This is more common on shared hosting or managed WordPress hosts.
In cPanel, look for MultiPHP INI Editor. Select your domain and find the line “memory_limit.” Change the value (e.g., 256M), save, and the setting applies server-wide. Some hosts like Kinsta, WP Engine, or SiteGround have their own interfaces where you can adjust PHP settings under a “Performance” or “PHP Config” tab.
If your hosting panel doesn’t have an option for this, you can often ask support to increase the limit. Be polite and specific: “I need to increase my PHP memory limit to 256MB for WordPress.” Most decent hosts will do this for free. If they say no, that’s a red flag about their quality.
This method is cleaner than .htaccess because it doesn’t risk Apache conflicts. It’s also safer for beginners because you’re not messing with code directly.
Method 3: Increase Memory Limit via .htaccess File (Legacy Method)
This is an older approach that works on Apache servers. I only recommend it if the other methods aren’t available and you know your server uses Apache (most shared hosts do).
Add this to your .htaccess file in the WordPress root:
php_value memory_limit 256M
This must go above the “# END WordPress” line. The risk here is that a single syntax error can bring your entire site down. If you’re not comfortable with .htaccess, skip this method. It also won’t work on NGINX servers or some managed hosting platforms. Stick with wp-config.php or your hosting panel.

What If You Cannot Increase the Memory Limit?
Sometimes your host has a hard cap. I’ve seen cheap shared hosting plans locked at 64MB or 128MB with no way to raise it. If you hit this wall, you have a few options:
- Contact host support and ask if they can raise the limit. Some hosts will do it if you ask nicely.
- Upgrade your hosting plan to one that allows custom PHP settings. Often the jump from basic shared to business shared gives you 256M.
- Switch hosts if your current one refuses. This is a sign of a low-quality provider.
- Audit your plugins and remove any memory hogs. But this is a band-aid, not a cure.
If your site consistently needs more than 256MB and you’ve already optimized, it’s time for a better host. Don’t try to force a limit that doesn’t exist. You’ll just cause errors.
Common Mistakes When Increasing the PHP Memory Limit
I’ve seen these mistakes repeatedly in support forums. Avoid them:
- Wrong syntax: Using
256 MBinstead of256M. The “M” must be attached without a space. - Wrong location: Placing the code after the “That’s all” comment instead of before it. This breaks the file.
- Forgetting file permissions: If your wp-config.php file is read-only, you can’t edit it. Not a common problem, but it happens.
- Not clearing cache: Server-level caching (like Redis or Varnish) might keep the old value visible. Clear your cache and restart PHP if possible.
- Using .htaccess when on NGINX: This does nothing and might break your site. Know your server type.
Double-check your edits before saving. A mistake might take your site down. Always have a backup of the file or your entire site before editing core files.
How to Verify the Change Took Effect
After making the change, go back to Tools > Site Health > Info and look at the PHP memory limit. It should now show your new value. If it still shows the old number, try clearing your site cache, any server cache (like via your hosting panel), and refreshing the page.
If Site Health still shows the old value, check that you edited the correct file and that the syntax is correct. Sometimes a host’s PHP-FPM service needs a restart. You can usually do that from cPanel or your hosting panel under “PHP-FPM Restart” or similar. If you’re on a managed host, support can do this for you.
Another way to verify is by creating a phpinfo file. I don’t recommend leaving it live for security, but you can use it to check once and then delete. If everything looks right, you’re good.

Does Increasing the Memory Limit Affect Site Speed or Hosting Resources?
This is a common worry. Raising the limit doesn’t automatically slow your site down. It’s an allocation cap, not a constant draw. Your site will only use what it needs. Setting the limit to 256MB while your site only needs 80MB is fine.
However, there’s a catch. A higher limit won’t fix poorly coded plugins that leak memory. If a plugin is inefficient, it might try to use more memory than it should, and a higher limit just lets it run longer before crashing. Find that plugin and replace it. You can safely increase memory, but always pair that with good plugin hygiene.
From a hosting resource perspective, a single 256MB PHP process is not the same as using 256MB of RAM constantly. Most shared hosts can handle that easily. If you’re running a high-traffic site, the real resource drain comes from server load, not the memory limit itself.
Alternative Solutions: Reduce Plugin Overhead Instead of Increasing Memory
Sometimes the best fix isn’t a higher limit but a leaner setup. Before you bump memory, audit your plugins. Look for:
- Multiple caching or security plugins doing the same job
- Heavy page builders like Divi, Elementor, or Beaver Builder that consume memory on every page edit
- Plugins with poor reviews or no recent updates
- Media-heavy plugins that load large scripts on all pages
Consider switching to a lighter theme like GeneratePress or Kadence, which are built for speed. Use a caching plugin like WP Rocket or Litespeed Cache to reduce PHP load. And if you’re using a drag-and-drop builder, see if your host offers server-level caching to offset the performance hit. Reducing overhead can often solve memory issues without changing the limit at all.
When to Call a Professional or Upgrade Your Hosting Plan
If you’ve tried all the methods above and your site still throws memory errors, it’s time for a deeper look. A developer can identify memory-hungry processes, optimize database queries, or rewrite custom code. Sometimes the problem isn’t the limit but a plugin or theme doing something inefficient.
Also consider upgrading your hosting. If your site consistently needs more than 256MB and you’re on shared hosting, you’ve outgrown it. A managed WordPress host like WP Engine or Kinsta often includes higher limits, better caching, and proactive support. A VPS from SiteGround or Cloudways gives you full control. The tradeoff is cost, but if you’re running a business site, the reliability is worth it.
If you’re not comfortable with server-level changes, paying a professional for a one-hour audit can save you days of frustration. It’s an investment in uptime.

Frequently Asked Questions About WordPress PHP Memory Limit
What’s the default WordPress memory limit?
WordPress itself sets a default of 40MB on front-end and 64MB for admin. Many hosts override these to 64MB or 128MB. You can safely raise it to 256MB without issue.
How do I check memory limit without admin access?
If you can’t log into WordPress, use an FTP client to download your wp-config.php file. Open it and look for the WP_MEMORY_LIMIT constant. If it’s not there, the limit is whatever your host sets. You can also ask your host support for the value.
What is WP_MAX_MEMORY_LIMIT?
This constant sets the absolute maximum for a single PHP process on the admin side. It’s used by plugins and WordPress updates. If you only use WP_MEMORY_LIMIT, that sets both front-end and admin. If you want a higher cap for admin tasks but not front-end, use WP_MAX_MEMORY_LIMIT and set WP_MEMORY_LIMIT lower. For most users, just set WP_MEMORY_LIMIT.
Will increasing memory limit fix the white screen of death?
Sometimes yes, but not always. The white screen can be caused by plugin conflicts, theme errors, or even PHP version issues. Increasing memory helps if the error is specifically “memory exhausted.” For other causes, you need to debug further.
Final Thoughts: Get Your WordPress Memory Limit Right the First Time
If you take one thing from this guide, it’s this: editing your wp-config.php file to set the memory limit is the easiest and most reliable fix. Start with 256MB for most sites, and verify the change using Site Health. If you still have problems, audit your plugins or upgrade your hosting. The memory limit is a tool, not a magic wand. Use it alongside good site management to keep your WordPress site running smoothly.