Increase WordPress Memory Limit: If you’ve been using WordPress for a while, you might have encountered the frustrating “Allowed memory size exhausted” error. This issue arises when WordPress reaches its memory limit, which restricts its ability to execute certain tasks, especially when running complex plugins or themes. Fortunately, increasing the WordPress memory limit is a straightforward process that doesn’t require advanced technical expertise.
In this guide, we’ll walk you through everything you need to know about increasing the WordPress memory limit, including what it is, why it matters, and actionable steps to resolve memory-related issues.
What Is the WordPress Memory Limit?
The WordPress memory limit refers to the amount of server memory allocated to PHP scripts that run WordPress. By default, most hosting providers set a low memory limit, such as 64MB or 128MB, which may be insufficient for resource-intensive websites.
When your website requires more memory than allocated, you’ll see errors like:
- “Fatal error: Allowed memory size of X bytes exhausted.”
- Plugins or themes failing to work properly.
- Slow website performance.
Increasing the WordPress memory limit ensures your site can handle more complex operations and provides a smoother experience for visitors.
Why Should You Increase the WordPress Memory Limit?
There are several reasons why increasing the WordPress memory limit is crucial for maintaining your website:
- Enhanced Performance: Larger memory limits allow WordPress to execute tasks faster, especially for websites with heavy traffic or high customization.
- Prevent Plugin Conflicts: Many modern plugins, such as WooCommerce or Elementor, require higher memory limits to function seamlessly.
- Improved Stability: A low memory limit can cause frequent crashes, impacting the user experience and your SEO ranking.
- Support for Resource-Intensive Features: Advanced themes, HD images, and embedded media consume more memory, necessitating a higher limit.
How to Check Your Current WordPress Memory Limit
Before increasing the memory limit, it’s important to verify the current allocation.
- Using the Site Health Tool:
- Go to your WordPress dashboard.
- Navigate to Tools > Site Health > Info.
- Scroll to the Server section to find the PHP memory limit.
- Check via phpinfo():
- Create a
phpinfo.php
file in your website’s root directory. - Add the following code:
<?php phpinfo(); ?>
- Access the file in your browser (
yoursite.com/phpinfo.php
) to view server information, including the memory limit.
- Create a
Increase WordPress Memory Limit Steps To Take
Here’s a step-by-step guide to increasing the WordPress memory limit. Choose the method that best suits your technical comfort level and hosting setup.
1. Edit the wp-config.php File
The wp-config.php
file is a core configuration file in WordPress. Modifying it allows you to increase the memory limit easily.
- Access your website via FTP or File Manager (found in your hosting cPanel).
- Locate the
wp-config.php
file in the root directory. - Open the file in a text editor.
- Add the following line of code just above the line that says
/* That's all, stop editing! Happy blogging. */
:define('WP_MEMORY_LIMIT', '256M');
- Save the file and upload it back to the server.
Note: You can adjust the
256M
value to your desired limit, such as 512M for larger sites.

2. Modify the PHP.ini File
If you have access to your server’s PHP.ini file, this is another way to increase the memory limit.
- Log in to your hosting control panel or access your server via SSH.
- Locate the
PHP.ini
file (usually found in the root directory). - Open the file and look for the line:
memory_limit = 128M
- Change the value to your desired memory limit, e.g.,
memory_limit = 256M
. - Save the changes and restart your server if necessary.
Important: If you can’t find the
PHP.ini
file, contact your hosting provider for assistance.
3. Use the .htaccess File
For shared hosting environments where PHP.ini
access is restricted, the .htaccess
file is a viable alternative.
- Locate the
.htaccess
file in your root directory. - Add the following line to increase the memory limit:
php_value memory_limit 256M
- Save the file and check if the issue is resolved.
Warning: Be cautious when editing the
.htaccess
file as incorrect syntax can break your site.
4. Leverage Your Hosting Control Panel
Many hosting providers offer user-friendly interfaces to change the PHP memory limit:
- Log in to your hosting account.
- Navigate to PHP Settings or MultiPHP Manager (specific names vary by host).
- Adjust the memory limit to a higher value.
This is the easiest method for non-technical users, as it doesn’t require file editing.
5. Install a Plugin
If you prefer an effortless approach, you can use WordPress plugins like WP Increase Memory Limit or Advanced PHP Settings to adjust the memory limit.
- Install and activate the plugin.
- Follow the plugin’s settings page to configure your desired memory limit.
Troubleshooting Common Issues
Sometimes, increasing the memory limit may not immediately resolve the issue. Here’s what to do:
- Confirm the Changes: Revisit the Site Health tool or phpinfo page to ensure the new memory limit is applied.
- Check for Syntax Errors: Ensure there are no typos in the files you edited.
- Contact Hosting Support: If all else fails, your hosting provider might need to increase the limit from their end.

Best Practices for WordPress Memory Management
While increasing the memory limit is a quick fix, consider optimizing your site for better memory usage:
- Deactivate Unnecessary Plugins: Running too many plugins can strain your server.
- Optimize Images: Compress large images using tools like TinyPNG or Smush.
- Update Regularly: Outdated plugins and themes may consume more resources.
- Enable Caching: Tools like WP Super Cache or W3 Total Cache reduce server load.
Conclusion
Increasing the WordPress memory limit is an essential skill for anyone managing a WordPress site, especially as your site grows in complexity and traffic. By following the methods outlined above, you can easily resolve memory-related errors and ensure your website runs smoothly.
Remember to regularly monitor your site’s performance and implement best practices to minimize memory usage. With these steps, you’ll not only fix errors but also enhance the overall stability and speed of your website.
By addressing memory limitations effectively, your WordPress site can deliver a seamless user experience, ensuring it remains competitive in today’s fast-paced digital landscape.