Categories

Roles

Talk to us about a team › Hourly, monthly or fixed scope — Schedule a call ›

Increase WordPress Memory Limit Easily: Step-by-Step Guide

Digital4designJune 16, 2026 4 min read

One of the most common technical issues WordPress site owners face is the WordPress memory exhausted error, often shown as the "Allowed memory size exhausted" message.

This usually happens when the site hits its WordPress memory limit, a preset cap on how much memory PHP scripts can use while running your site.

One user, on the official WordPress.org support forum, reported over 200 memory exhaustion errors in a single day. It was all tied to reaching a 256 MB memory cap during normal site usage. The plugin team advised raising the PHP memory limit to stop interruptions.

wordpress error

Source: WordPress Memory Limit Exhausted

Such an error seems overwhelming. But the best thing is, you do not need to become a developer to fix it. Increasing your memory limit is one of the simplest ways to improve your site’s stability and performance. A small configuration change can help avoid site crashes, allow large media uploads, and fix plugin errors.

In this blog, we’ll talk about how to increase the WordPress memory limit step-by-step in 2026. It will ensure your site runs faster, smoother, and without those annoying memory-related issues.

First, let’s start by understanding what the WordPress memory limit is.

🔧 Quick Fix to Increase WordPress Memory Limit (2026)

  • Edit wp-config.php: Add define('WP_MEMORY_LIMIT', '256M');
  • Try php.ini or .htaccess if needed
  • Use a plugin or hosting panel if non-technical
  • Contact host for server-level changes

What is WordPress Memory Limit?

The WordPress memory limit is the maximum amount of memory your website can use to run PHP scripts. WordPress uses a language called PHP to load your site, run themes, and handle plugins. All of these actions need server memory to work properly.

You may further face hassles such as slow site loading, broken plugins, or 404 errors. Additionally, your site might display an error message like Allowed memory size exhausted” or a general “There has been a critical error on this website.”

This occurs when any of your tasks tries to utilize more space than it is already allocated. As a result, PHP simply stops operating, and your site can crash.

What Are the Causes of WordPress Memory Limit Errors?

The common reasons behind your WordPress memory limit exhaustion are as follows:

1. Heavy Database Queries

Some plugins or themes run complex database tasks that use a lot of memory, especially when the data isn’t optimized.

2. Old PHP Version

Older versions of PHP use memory less efficiently. Newer versions like PHP 8.x are better at handling memory. You can hire a PHP developer to upgrade your PHP version with ease and optimize your site. 

3. Large Plugins or Themes

Some plugins and themes are equipped with too many features that require proper functioning.

4. High Traffic

More visitors mean more work for the server. WordPress builds pages for each user. It gradually increased the memory usage.

5. Big Media Files

Uploading videos or large images causes short-term spikes in memory usage during the file processing.

6. Autoloaded Data

Some plugins load extra data on every page unnecessarily, which adds to the memory load.

How to Check Your Current WordPress Memory Limit?

It’s good to check how much memory your site is currently using before you jump into increasing the memory limit.

Method 1: Use the WordPress Dashboard
  1. Go to Tools > Site Health.

wordpress website dashboard screenshot

2. Click on the Info tab at the top.

wordpress site health screenshot

  1. Now, click on Server.

Look for the line that says PHP memory limit. This shows the current limit set on your server.

php memory limit

Method 2: Use a Plugin

You can install a plugin like Server Info or WP-ServerInfo. These show the PHP memory 

limit, along with other server details on your dashboard.

Method 3: Use a phpinfo() File

Create a file named phpinfo.php in your root directory. Add this line inside it:

syntax of php

The next thing you need to do is open the file in your browser (e.g., yourdomain.com/phpinfo.php). Upon opening the file, you’ll see a page with all your PHP settings, including the memory limit.

Besides all this, backing up your site is essential before making any changes. It saves you from potential issues or errors during the update.

Start by backing up these two things:

  • wp-config.php file – This is where you’ll be making changes.
  • Your WordPress database – Just in case anything goes wrong, you’ll have a copy to restore your content and settings.

Ways to Increase WordPress Memory Limit

Here are some proven tricks for how to increase the WordPress memory limit and avoid common errors. The first method is commonly used and mostly recommended.

Method 1: Edit wp-config.php

This is the easiest and most compatible way.

Steps:

  1. Firstly, find your files using FTP, cPanel, or your hosting file manager.
  2. Next, open the wp-config.php file, found in the main WordPress folder.
  3. Next step is to define(‘WP_MEMORY_LIMIT’, ‘256M’).
  4. You can also allow more memory for the admin area.

Now, save and upload the file back to your server.

Method 2: Edit php.ini

If editing wp-config.php doesn’t work, you can try updating the php.ini file.

Steps:

  1. Begin by looking for a php.ini file in your root directory. Or you can ask your host for its whereabouts.
  2. If you fail to find the file, then create a new file named php.ini.
  3. Add or update the memory_limit = 256M or change it as per your requirement.
  4. Save the file and restart PHP if your host allows it.

Remember, not all shared hosting plans allow access to php.ini.

Method 3: Edit .htaccess

This method works for sites hosted on Apache servers that allow overrides.

Steps:

  1. Open the .htaccess file in your WordPress root folder (usually public_html).
  2. Upon finding the file, set the memory limit to 64M, 128M, or 256M, whichever you need, and save and upload the file. 
Method 4: Use a Plugin or Hosting Control Panel

You can try these options to avoid manual edits.

  • Hosting Panel: Some hosts, like Hostinger or Bluehost, let you change the memory limit from your control panel under PHP Settings.
  • Plugin: You can use a plugin like File Manager to edit wp-config.php, or a memory boost plugin. But plugin methods are less reliable.
Method 5: Contact Your Hosting Provider

You can contact the hosting provider and ask them to unlock the memory limits on the server level if none of the above methods work.

What you can do:

  1. Open a support ticket and ask them to increase your PHP memory limit to 256MB or higher.
  2. Most managed WordPress hosts will do this quickly if you explain the problem.

WordPress Memory Limit vs PHP Memory Limit

Many website owners think the WordPress memory limit and PHP memory limit are the same thing. They are not.

Understanding the difference can save you a lot of time when troubleshooting memory errors.

The WordPress memory limit is the amount of memory WordPress is allowed to use.

The PHP memory limit is the maximum amount of memory your hosting server allows PHP to use.

Think of it this way.

WordPress can request more memory, but the server makes the final decision.

For example, you may add a 256MB memory limit in your wp-config.php file. However, if your hosting account only allows 128MB through PHP settings, WordPress will still be limited to 128MB.

This is one of the most common reasons memory limit changes do not work.

Example:

Let’s say your website has:

  • WordPress memory limit: 256MB
  • PHP memory limit: 128MB

Even though WordPress is asking for 256MB, the server will stop it at 128MB. As a result, you may continue seeing memory-related errors.

How to Check Both Limits?

You can view your PHP memory limit through:

  • WordPress Site Health
  • Your hosting control panel
  • A phpinfo() file
  • Hosting support

If the PHP memory limit is lower than the value you want to set in WordPress, you may need to update your server settings or contact your hosting provider.

Why This Matters

Before increasing the WordPress memory limit, always check the PHP memory limit first.

Many site owners spend time editing configuration files only to discover their hosting provider has set a lower server-level limit.

Knowing both values helps you avoid confusion and makes troubleshooting much easier.

WordPress Troubleshooting Tips If Memory Errors Continue

There are chances that you might still face issues even after you increase the WordPress memory limit. Well, you can troubleshoot the issues with the help of the practices shared below.  

1. Start with a Modest Limit

Setting the high limit directly is not the right choice and is not allowed by your host.

  • Recommended starting memory limit: 128M or 256M
  • Going higher may not make a difference unless your theme, plugins, or large imports truly need it.

Also, you should check with your hosting provider to know the maximum allowed memory limit.

2. Use Higher Limits When Necessary

While some resource-intensive themes or plugins (like WooCommerce, Elementor, or WPML) may benefit from 512M or higher, it’s usually overkill for standard blogs or portfolios. Use high values only if:

You should use a high memory limit only if:

  • Your admin dashboard becomes unresponsive
  • You’re importing large files or running backups
  • A plugin requires it
3. Try These Fixes If Errors Continue

Memory issues often signal something deeper than just low limits. Try the following:

  • You can deactivate heavy or unnecessary plugins temporarily to see which one is causing the error
  • Use compression tools and optimize your media
  • Upgrade your hosting plan if you’re on shared hosting
4. Restore a Backup

If your site crashes or starts showing critical errors after editing wp-config.php, .htaccess, or php.ini, don’t panic.

  • Restore your last working backup
  • Undo the changes you made

Also, you can hire a WordPress developer to manage backups and updates safely.

Final Thoughts

Running into memory limit errors in WordPress is common. But the good news is, it’s usually easy to fix. Whether you change a few lines in a file or ask your host for help, these steps can get your site back on track.

Also, if you’re not tech savvy or don’t have time to resolve such hassles, Digital4design is here to help. We offer WordPress development services, ongoing WordPress maintenance services, and expert support for websites experiencing memory errors, plugin conflicts, or performance issues.

Frequently Asked Questions

  • 1. What is the default WordPress memory limit?

    WordPress sets the memory limit to 40MB for single-site and 64MB for multisite installations by default. However, most modern plugins and themes need at least 128MB to 256MB for smooth functioning.

  • 2. Will increasing the memory limit speed up my site?

    It can help. But you should also look into caching, image optimization, and hosting quality for overall speed.

  • 3. I changed the limit, but still see errors. Why?

    Some hosting providers cap the memory at the server level. You’ll need to contact your hosting provider and ask them to increase it for you.

  • 4. Can Digital4design help if I need professional support?

    Yes. Digital4design offers expert WordPress development services and can help you fix memory issues, speed up your site, and keep everything running hassle-free.

Digital4design

One Response

  1. I always find it a bit tricky when WordPress memory limits come into play. It’s great to see that there are simple ways to adjust this without needing deep technical knowledge. Do you have any thoughts on how these changes might affect site performance in the long term?

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts