How to Increase WordPress Memory Limit?

Written By: author avatar Seahawk
author avatar Seahawk
Increase WordPress Memory Limit

WordPress, like any software, requires a certain amount of memory to run smoothly. The memory limit is the maximum amount of memory that WordPress can consume during its operations. Sometimes, WordPress memory limit may need to be increased due to various reasons, such as installing memory-intensive plugins, handling large media files, or processing complex tasks.

When the memory limit is too low, WordPress may encounter errors like Allowed Memory Size Exhausted or Out of Memory errors, leading to website crashes or failures in performing certain actions. Increasing the memory limit with regular WordPress maintenance can help resolve these issues and ensure that WordPress has sufficient resources to function properly.

Checking Your WordPress Memory Limit

Verifying the accessible memory limit within the WordPress admin dashboard involves a structured process. Here’s a step-by-step guide to navigate through the data before considering any adjustments to the WordPress memory allocation:

  1. Begin by accessing your WordPress admin users through authentication.
  2. Locate the Tools section in the menu on the left-hand side and select Site Health.
  3. Within the Site Health interface, direct your attention to the Info tab and proceed to explore the Server dropdown menu.
  4. The designated PHP memory limit value is located within the Server section, providing insight into the current memory allocation.

Alternatively, another method to ascertain the WordPress memory limit entails creating a file named phpinfo.php within a text editor. Populate this file with the prescribed code excerpt:

<?php phpinfo(); ?>. 

Subsequently, transfer this file to the root directory either via FTP or file manager. Upon completion, navigate to your web browser and enter the URL “http://yoursite.com/phpinfo.php,” substituting “yoursite.com” with your specific domain name. This action will generate a comprehensive PHP information page, including pertinent details such as the WordPress memory limit.

Getting ‘Out of Memory’ Error Message In Your WordPress Site?

Get 24X7 WP support to eliminate issues as this at incredibly low prices at just $59/hr!

Why Does WordPress Need More Memory Limit?

Increase WordPress Memory Limit

As your website grows and becomes more complex, it may require additional memory resources to handle various tasks and processes. The need for increasing the memory limit in WordPress can arise due to the following reasons:

  • Installing memory-intensive plugins or themes
  • Handling large media files (images, videos, etc.)
  • Processing complex operations (importing/exporting data, running scripts, etc.)
  • High traffic and concurrent user requests
  • Running resource-intensive applications or integrations

To increase the memory limit, one needs to modify the maximum upload size in the WordPress wp-config.php file, which is the core configuration file for WordPress. However, it’s important to be cautious when increasing the memory limit, as it can make it harder to identify inefficiencies within WordPress.

Before increasing the WordPress memory limit, it’s recommended to first try to identify what is consuming more memory. Throwing more resources at a problem can sometimes end up costing much more in the long term, especially if you have plans to upgrade the hosting environment.

Inefficiencies in WordPress can lead to a sluggish site and a poor user experience. To get the appropriate solution, you need to identify the root cause of the problem, which can help you solve a variety of issues down the road.

Keep Reading: 15+ Tips to Fix “There Has Been a Critical Error on Your WordPress Website” Issue

Steps to Increase WordPress Memory Limit

When WordPress memory limit is too low, it can lead to errors, crashes, or sluggish performance, especially when handling memory-intensive tasks like installing plugins, processing large media files, or running complex scripts.

Steps to Increase WordPress Memory Limit:

Edit the wp-config.php File

  • Connect to your server via FTP (File Transfer Protocol) using an FTP client like FileZilla.
  • Navigate to the root directory of your WordPress installation.
  • Locate the wp-config.php file and open it in a text editor.
  • Search for the line define( ‘WP_MEMORY_LIMIT’, ’32M’ ); (or a similar line).
  • If the line exists, increase the value from ’32M’ to a higher value, like ‘256M’ or ‘512M’.
  • If the line doesn’t exist, add the following line above the /* That’s all, stop editing! Happy publishing. */ line: define( ‘WP_MEMORY_LIMIT’, ‘256M’ );
  • Save the changes and upload the modified wp-config.php file back to your server.

Know How To: Safely Update WordPress from Version PHP 7 Without Breaking the Site

Change Server settings via PHP.ini (if available)

  • Check if your hosting provider offers a tool to edit the PHP.ini file (e.g., cPanel’s MultiPHP INI Editor or PHP Config).
  • Locate the line that includes memory_limit= and increase the value to a higher limit (e.g., memory_limit=256M).
  • Save the changes and restart your server for the new settings to take effect.

Read More: How to Optimize Your WordPress RSS Feeds: 20+ Tips & Strategies

Edit the .htaccess File

Increase WordPress Memory Limit
  • Connect to your server via FTP and navigate to the public_html directory (or the directory containing your WordPress installation).
  • Locate the .htaccess file and open it in a text editor.
  • Add the following line below the # END WordPress line: php_value memory_limit 256M (replace ‘256M’ with your desired limit).
  • Save the changes and upload the modified .htaccess file back to your server.

Keep Reading: Ultimate Guide to WordPress Error Logs: How to Enable, Find, and Fix it

Upgrade Your Hosting Plan (if necessary)

  • If you’ve tried all the above steps and are still encountering memory limit issues, it might be time to upgrade your hosting plan.
  • Check your current memory allocation and resource limits with your hosting provider.
  • Consider upgrading to a higher-tier plan, such as a Virtual Private Server (VPS) or a dedicated server, which typically offers more resources and flexibility.
  • When choosing a new hosting plan, look for providers that offer a default memory limit of 256 MB or higher and the ability to quickly increase resources as your website grows.

Know More: Fastest WordPress Hosting Companies

Pro Tip: Before increasing the WordPress memory limit, it’s always a good practice to identify the root cause of the memory consumption issue. Inefficiencies in your WordPress installation, outdated plugins, or suboptimal coding practices can contribute to excessive memory usage. 

Addressing these issues and starting best practices like plugins and themes auto-updates can sometimes eliminate the need to increase the memory limit altogether, leading to a more sustainable solution and better long-term performance.

Additionally, consider upgrading to the latest version of PHP, as newer versions are often more memory-efficient and can help reduce your WordPress site’s overall memory footprint.

Not Sure How Often to Update Your Plugins?

Rely on our expert maintenance pros to stay up-to-date. Prices starting at just $49/month!

Why Do We Encounter WordPress Memory Limit Error?

Increase WordPress Memory Limit

Addressing the memory limit error is important because it can prevent you from performing essential tasks on your WordPress site, such as adding new content or updating plugins. By increasing the memory limit or improving performance through WordPress speed optimization, you can ensure that your site runs smoothly and without interruptions.

It typically occurs when your website tries to perform an operation that requires more memory than what is currently allocated. This error message typically looks like this –

Fatal error: Allowed memory size of X bytes exhausted.

Why does this error happen? 

When you purchase web hosting for your WordPress site, the hosting provider allocates a certain amount of memory (RAM). This memory stores and processes all the data and files related to your website, such as content, images, plugins, and themes.

But if your website tries to handle a task requiring more memory than currently available, WordPress will throw the memory limit error. This can happen on several occasions, like –

  • When you try to upload large media files
  • Install memory-intensive plugins, or 
  • Perform complex operations that consume a lot of memory

Wondering how it can be fixed? There are several ways to fix the WordPress memory limit error:

  1. Increase the memory limit: You can increase the amount of memory allocated to your WordPress site by editing the wp-config.php file or modifying the server settings (if you have access to them).
  2. Optimize your website: Sometimes, the memory issue can be caused by inefficient code, outdated plugins, or other performance bottlenecks. Optimizing your website by removing unnecessary plugins, compressing images, and implementing caching can help reduce memory usage.
  3. Upgrade your hosting plan: If you’ve tried increasing the memory limit and optimizing your website but are still encountering the error, it might be time to upgrade to a higher-tier hosting plan that provides more memory and resources.

Find More Insights: Ultimate Guide For WordPress Speed Optimization

Conclusion

The real challenge with the WordPress memory limit issue is not just fixing the error itself. It’s about rolling up your sleeves and really digging into what’s causing your site to guzzle up so much memory in the first place. Is it outdated plugins or themes that need updating? Maybe there’s some inefficient code that needs optimizing? Or perhaps your hosting plan simply can’t keep up with the demands of your growing site anymore.

Once you identify and tackle that root cause, whether upgrading software, streamlining code, or moving to more robust hosting, it is like a whole new world opens up for your website. Suddenly, it is running smoother, loading faster, and handling even the most complex tasks without breaking a sweat. Your visitors will appreciate the snappier experience, and you’ll enjoy the peace of mind that comes with a site operating at peak performance.

Pushing through and resolving the WordPress memory limit now sets you up for long-term success down the road. As your site grows and evolves, you will have the resources and optimizations in place to keep scaling effortlessly. So don’t view this as just another technical headache—this is n opportunity to unlock your WordPress site’s full potential truly.

Related Posts

WordPress Database Plugins

WordPress Database Plugins for Efficient Data Management

Over time, the database behind your site, where all your content and settings are stored,

How to Create a WordPress Client Portal for Your Agency

How to Create a WordPress Client Portal for Your Agency in 2025?

As an agency owner, you have probably tried several ways to keep your clients happy

Wix vs WordPress

Wix vs WordPress: Which is the Best Platform in 2025?

Establishing a strong online presence is vital for businesses and personal endeavors alike. Before creating

Get started with Seahawk

Sign up in our app to view our pricing and get discounts.