
How to edit the WordPress excerpt length easily
April 24, 2025Inspiring Examples of Startup Landing Pages
April 25, 2025Ever stared at the dreaded "Fatal error: Allowed memory size exhausted" message on your WordPress site? This frustrating error often appears when your site needs more resources than it's allowed to use.
WordPress memory issues can bring your entire website crashing down without warning. When your site hits these memory allocation errors, visitors see error messages instead of your content, potentially hurting your reputation and search rankings.
Learning how to increase the WordPress memory limit isn't just a technical fix. It's an essential skill for anyone running or managing a WordPress site. Proper PHP memory configuration ensures your site runs smoothly, loads quickly, and handles all your plugins without breaking.
This guide will walk you through:
- Multiple methods to adjust your WordPress configuration file
- Step-by-step instructions for different web hosting environments
- Practical troubleshooting for common memory exhausted errors
- Tips to optimize WordPress performance beyond memory limits
By the end, you'll have the knowledge to fix current memory problems and prevent future WordPress resource limits from affecting your site.
About WordPress Memory Limit

If you tend to expand your website with new content, images, visual content, plugins, and various scripts, the performance of your site will decline, and eventually, you will reach the WordPress memory limit.
Then you will most likely get a PHP memory limit error often quite familiar to seasoned WordPress users. The error occurs when WordPress doesn’t have sufficient memory to complete the request you asked from it. The more plugins and scripts you use, the more memory it will use and even more memory if the plugin is poorly optimized, or if the installation takes too much memory.
Once you reach that WordPress memory limit, running your site becomes a problem. Your website requires a certain amount of memory to store all your files, including all the visual content, plugins, database, code, themes, and much more. Unfortunately, the WordPress memory limit restricts the amount of usable memory.. You can, however, increase it quite easily.
I'm interrupting the article to tell you about BeTheme, the definitive multipurpose theme. If trying to satisfy multiple clients has become more stressful than rewarding, BeTheme is the solution for that.

BeTheme’s selection of hundreds of customizable, responsive pre-built websites is the highlight and a proven stress reducer.
The customizability of the theme makes it a dream come true for its users. There are 4 types of Page Builders that you can use with it: WPBakery, BeBuilder, and Elementor among them.
And now with the Live Builder, it’s even more impressive.
Check out BeTheme and see why our users love it!
The rest of the article is down below.
Your hosting server also imposes a limitation. The provider who hosts your site will provide you with a certain amount of resources (memory) to manage all your files. Therefore the amount of memory you receive is largely dependent on your hosting provider.
You should carefully consider which provider you choose for your website. Choosing a high-quality provider makes sense, especially if you plan to expand your website over time, and consequently use more memory. For beginners, choosing more expensive plans is probably not ideal; however, with time, it might be a good option to consider expanding.
How to Increase the WordPress Memory Limit
It is relatively easy to increase the WordPress memory limit.. It is a very clear problem and the solution is also pretty clear, so there is no need to go very deep into its cause..
Three different methods are provided to fix this problem:
Method #1: Increase the PHP memory allocated to your website by changing the wp-config file

The most intuitive and relatively easy solution is basically to allocate more memory to your site than what has been allocated.
However it will only work if you still have space to increase the memory with your hosting provider.
You normally use much less memory than the provider actually offers. There are different memory limits, depending on the provider, and you need to set it regardless of what is offered.
You can find your allocation in the wp-config.php file, so access that file first. The memory limit in this file might not be the same as that of the provider. You will need to change the file in such a way that it increases the WordPress memory limit.
This file is not built-in with your website but comes separately as a part of your installation, so you need to locate it in the root folder of your WordPress site. You need to use an FTP client or other suitable file manager software.
To increase the memory to 256MB, for example, you will need to add this line into the file, right before the line that says “Happy Blogging”:
define('WP_MEMORY_LIMIT', '256M');
With this command, you will define the WordPress memory limit to 256MB, but you can change the value to your liking (as long as it is enough for your provider to handle.)
The last step is to save the file and upload it again to the server. Now you should be able to access more memory.
Method #2: Editing the PHP.ini File

If editing the wp-config.php file hasn’t worked, you can try to change your server’s settings instead of the WordPress files.
If you can access the file, then you will be able to find the file within your root folder, or where your service provider keeps it.
Go to your wp-admin folder, and try to locate the php.ini file, or the php5.ini file. If the file is there, which is unlikely, double-click on it and download it to your PC. Open it.
If the file isn’t there, then you will have to open the text editor, and open the php.ini file. Then, locate the line where your memory is specified with the memory_limit and the M values. You will need to change those lines:
If the line shows 64M as the memory limit, change it to 256M with this line:
Memory_limit = 256M
Hopefully, this will work. Please note this option doesn’t apply for shared hosting, which does not permit access to the PHP.ini file. The next method will help those who use shared hosting.
Method #3: Edit the .htaccess file

If you haven’t yet been able to change the WordPress memory limit by altering the php.ini or wp-config files, you can try changing the .htaccess file. This file will normally be a hidden file, so first you need to make the file visible within your root folder.
Then double click on the file and download it to your computer. Locate the line where your memory limit is specified, and change it by adding this passage of code; if you can’t locate it, then add it anyway:
php_valuememory_limit 512M
This will change the limit to 512MB. Next, you will have to save the file and overwrite the original. Next, refresh the FTP client, and refresh your site.
If the solution doesn’t work, then you will have to delete the line and try another solution. If it works, save the file to your root directory.
Backup Method: Contact Your Host

If you want to increase the WordPress memory limit, and the other methods haven’t worked, you can try contacting your host provider to give you a solution.
In some cases, you will not be able to do it manually, and your provider will have to do it for you. In some cases, this is the easiest and best solution, especially for those with shared hosting.
because you can’t access the php.ini file, where you can normally make the changes by yourself. If the hosting isn’t allowing you to increase the limit, then the only solution might be to change the hosting provider, or upgrading to a higher tier with your current provider.
FAQ about the WordPress memory limit
What is the default WordPress memory limit?
The default WordPress memory limit is 32MB for single sites and 64MB for multisite installations. This baseline allocation is often insufficient for sites with multiple plugins or complex themes, leading to memory exhausted errors. Many hosting providers automatically set higher limits.
How do I know if I need to increase my WordPress memory limit?
Watch for these signs: white screen of death, "fatal error: allowed memory size" messages, slow WordPress admin loading, or plugin activation failures. Use a memory usage optimization plugin to monitor your site's resource consumption. Sites with many features typically need more memory.
Can I edit wp-config.php to increase memory?
Yes. Adding define('WP_MEMORY_LIMIT', '256M');
to your wp-config.php file is often the most effective solution. This WordPress configuration change applies to front-end viewing. For admin areas, add define('WP_MAX_MEMORY_LIMIT', '256M');
too. Always backup before editing.
What if I don't have access to wp-config.php?
Try alternative methods like creating or editing .htaccess to add php_value memory_limit 256M
. For PHP.ini control, add memory_limit = 256M
. Some hosting environments provide memory controls through cPanel or custom dashboards.
How much memory should I allocate to WordPress?
Most sites run well with 128MB to 256MB. Complex sites with many plugins may need 512MB or more. Never exceed your server resources or hosting limits. Start with 128MB and increase gradually until error troubleshooting shows problems are resolved.
Can increasing memory cause problems?
Rarely. Setting limits beyond your hosting plan capabilities might trigger overages or server issues. Some low-quality shared hosting environments restrict PHP settings regardless of your configuration attempts. The main risk is masking underlying plugin memory consumption problems.
Do I need to increase memory for every WordPress site?
No. Only increase limits when experiencing memory allocation errors or WordPress performance issues. Many sites run perfectly on default settings. Resource-heavy plugins, page builders, and media-intensive sites typically need memory increases for proper site loading.
Will my hosting provider allow memory increases?
It depends. Shared hosting often restricts PHP memory configuration. VPS, dedicated hosting, and WordPress-specific hosts usually allow adjustments. Check your hosting documentation or contact support before attempting changes to server memory settings.
How do I check my current memory limit?
Create a PHP file with <?php phpinfo(); ?>
and upload it to your server. Look for "memory_limit" in the results. Alternatively, install a WordPress plugin like Query Monitor or check your error log for mention of current limits in memory exhausted messages.
What if increasing memory doesn't solve my problem?
Look deeper at WordPress optimization. Consider deactivating resource-hungry plugins, switching to a lighter theme, or optimizing your database. Sometimes the issue isn't memory but PHP version compatibility, maximum execution time, or inefficient code requiring debugging.
Conclusion
Learning how to increase the WordPress memory limit can save your website from frustrating crashes and keep your visitors happy. With the methods we've covered, you now have practical solutions for fixing memory allocation issues that previously might have seemed overwhelming.
Remember that WordPress optimization goes beyond just throwing more server resources at the problem. Smart site management includes:
- Regular WordPress maintenance to clean up database bloat
- Careful evaluation of plugin memory usage before installation
- Choosing a quality web hosting provider with flexible PHP settings
- Monitoring your WordPress error logs for early warning signs
The most effective approach combines proper memory limit configuration with thoughtful site development. This balanced strategy prevents the white screen of death while ensuring your site remains fast and responsive. By implementing these techniques, you'll not only fix current memory exhausted errors but build a stronger foundation for your website's future growth.
If you enjoyed reading this article on how to increase the WordPress memory limit, you should check out this one about how to use toolset.
We also wrote about a few related subjects like
how to redirect 404 to homepage,
how to downgrade WordPress,
how to install google tag manager on WordPress,
how to embed a google form in WordPress,
how to see the current WordPress version and
how to change the author in WordPress.