Introduction
WordPress is a super popular content management system (CMS) that runs millions of websites around the globe. But even with all its technical superpowers, it is also bound to be hit by a snag, especially when you make use of data-heavy plugins. This is particularly common in WooCommerce development, where e-commerce functionality can be resource-intensive.
In such a case, you might encounter the common error message that says, “allowed memory size exhausted”.
This error occurs when your WordPress website does not have the minimum required PHP memory limit to allow it to function smoothly.
In this blog, we will guide you through checking your current memory allocation and provide actionable steps to increase WordPress memory limit for optimal site performance.
Benefits of Increasing WordPress Memory Limit?
When you increase the PHP memory limit, it will help your WordPress website in several ways:
- Avoid White Screen of Death (WSOD) – A WSOD is a blank white screen indicating a memory exhaustion error. Increasing the memory limit will help you avoid this error.
- Avoiding Plugin / Theme Installation Errors – Enhanced memory limit will help you to overcome errors associated with use of memory exhaustive plugins and themes.
- Improved Website Performance – More PHP memory limit will help your website to address more user traffic without impact on website performance.
Master Tip – If you are setting the memory limit too high, it may result in web server overloading. This problem becomes especially critical in cases where you are on shared web hosting plans.
How to Check WordPress Memory Limit?
The default memory limit for a WordPress website is generally set to 32MB. However, this may not be sufficient when you are running a global complex website.
Therefore, before working towards increasing the memory limit, let’s understand the steps to check the current PHP memory limit. You can do this through following ways –
- Using a WordPress Site Health Tool – Login to WordPress Dashboard. Once you are logged in, navigate to Tools > Site Health.

Click on Info > Expand the Server section > Check the PHP memory limit.

- PHP Info File – Create a new phpinfo.php file in your website’s root directory and add the following code <?php phpinfo(); ?>.
Once this is done, access this file through your web browser to see the current PHP memory limit.
- Check the wp-config.php File:
- Access your WordPress website’s root directory using FTP or cPanel File Manager.
- Open the wp-config.php file in a text editor.
- Look for below lines to see if any custom limits are set.
define(‘WP_MEMORY_LIMIT’, ‘xxxM’); or define(‘WP_MAX_MEMORY_LIMIT’, ‘xxxM’).
Methods to Increase WordPress Memory Limit
- Editing wp-config.php File
- Access your WordPress Website root directory via FTP or file manager.
- Locate and open the wp-config.php file with text editor. Don’t forget to a backup of wp-config.php for your own safety.

- Add following line before /* That’s all, stop editing! Happy publishing. */ line –
define(‘WP_MEMORY_LIMIT’, ‘256M’);

- Replace the number ‘256M’ with your desired memory limit.
- Save the file and upload it back to the server.
- Modifying .htaccess File
This method is used to increase memory limit when you are not able to edit php.ini.
- Access your WordPress Website root directory via FTP or file manager.
- Open the .htaccess file with a text editor or find the .htaccess file in website’s public_html folder or root directory.

- Add the following line – php_value memory_limit 256M below the line # End WordPress

- Save the file and upload it back to the server.
- Refresh your website to implement the changes.
- Updating php.ini File
- Access your website server’s root directory via FTP or file manager.
- Locate the php.ini file and if the file doesn’t exist, create one.
- Add or modify the following line in the php file-
memory_limit = 256M
- Save the file and upload it back to the server.
- Refresh your website.
- Using a Plugin
Some WordPress plugins allow you to adjust the memory limit for your website directly from the WordPress dashboard.
- Install and activate the WP Memory Limit plugin.
- Go to Settings > WP Memory Limit.
- Set the desired memory limit and save changes.

- Upgrade the Web Hosting Plan
If any of the methods mentioned above don’t work due to hosting provider restrictions, consider upgrading your hosting plan to that offer more resources and features for a better website performance.
Conclusion
Having a functional website accessible to users with a few clicks is the need of the hour in today’s internet age. Ensuring that your website has a sufficient PHP memory limit can help you resolve various accessibility issues and improve the website’s performance.
By following the methods outlined in this blog, you can easily increase the memory limit and ensure your WordPress site runs smoothly.
Ready to Optimize Your WordPress Site’s Performance?
Don’t let memory limit errors slow down your website or frustrate your visitors. Follow our comprehensive guide to increase your WordPress memory limit and unlock your site’s full potential.
Take action now and implement these proven methods to boost your WordPress performance. Need expert assistance with WordPress optimization development services? Our team is here to help you achieve lightning-fast loading times and seamless user experiences.
Frequently Asked Questions
- What is the default WordPress memory limit?
The default memory limit for WordPress is 32MB for single-site installations and 64MB for multisite installations.
- How much memory should I allocate to WordPress?
There is no specific definition of the memory limit. It completely depends on your website’s requirements.
Generally, 128MB to 256MB is sufficient for majority of the websites. However, if you are operating website that is resource-intensive, you may need more memory.
- Will increasing the memory limit affect my website’s performance?
Yes, increasing the memory limit can significantly improve your WooCommerce website’s performance by allowing it to handle more processes simultaneously.
- Can I increase the memory limit through my hosting provider?
Yes, many hosting providers allow you to increase the memory limit through their control panel or by contacting their support team.
- What should I do if I still encounter memory limit issues after increasing it?
If you continue to experience issues, consider optimizing your website by disabling unnecessary plugins, optimizing your database, and using a caching plugin.