How to Increase WordPress Memory Limit: Complete Guide
Last updated: 31 December 2025
How to Increase WordPress Memory Limit: Complete Guide [2025]
The dreaded "Fatal error: Allowed memory size exhausted" message is one of the most common WordPress problems. In this comprehensive guide, we explain what the memory limit is, why you might need to increase it, and provide multiple methods to solve this problem.
What is the WordPress Memory Limit?
The WordPress memory limit determines how much memory (RAM) PHP can use to run WordPress. By default, this is often set to 32MB or 64MB, which is frequently insufficient for modern WordPress websites with many plugins and themes.
Why is the Memory Limit Important?
WordPress constantly performs tasks that require memory:
- Generating pages: Every page request requires memory
- Loading plugins: Each plugin uses memory
- Processing images: Uploading and scaling images is memory-intensive
- WooCommerce: Online stores need extra memory for products and orders
- Page builders: Elementor, Divi, and other builders are memory-intensive
Symptoms of Insufficient Memory
You can recognize a memory shortage by these signals:
- "Fatal error: Allowed memory size of X bytes exhausted"
- White pages (White Screen of Death)
- Plugins that won't activate
- Images that won't upload
- Slow website performance
- Admin panel crashing
Checking Your Current Memory Limit
Before making any changes, first check your current limit.
Method 1: Via WordPress Admin
- Go to Tools → Site Health in your WordPress dashboard
- Click on Info
- Look for Server → PHP memory limit
Method 1: Via wp-config.php (Recommended)
This is the most reliable method and works with almost all hosting providers.
Steps
- Open your FTP client or file manager in your hosting panel
- Navigate to the root of your WordPress installation
- Open the
wp-config.phpfile - Add the following line BEFORE the line
/* That's all, stop editing! */:
define('WP_MEMORY_LIMIT', '256M');
- Save the file
Different Values
- 128M: Suitable for simple websites
- 256M: Recommended for most websites
- 512M: For WooCommerce or heavy plugins
- 1024M: For complex websites with lots of functionality
Method 2: Via .htaccess
Only works on Apache servers (most shared hosting).
php_value memory_limit 256M
Method 3: Via php.ini
Some hosting providers allow a custom php.ini file:
memory_limit = 256M
Conclusion
Increasing the WordPress memory limit is an essential skill for every WordPress administrator. The most reliable method is via wp-config.php.
Summary of steps:
- Check your current memory limit
- Try the wp-config.php method first
- If that doesn't work, try .htaccess or php.ini
- Check your hosting panel for PHP settings
- Contact your hosting if nothing works
Frequently Asked Questions
How long does it take to implement this?
Implementation time varies per situation. Simple configurations can be done within an hour, more complex setups may take several hours to a day.
What are the costs?
Costs depend on your hosting provider and package. Many basic features are included for free, advanced features may incur additional costs.
Do I need technical knowledge?
You need little technical knowledge for the basics. Most hosting providers offer extensive documentation and support to help you.
Was this article helpful?
Compare hosting packages directly to find the best choice for your situation.
Related articles
What is web hosting? Explanation for beginners
Discover what web hosting is and how it works. Complete explanation about servers, domains and different hosting types for beginners.
What is VPS Hosting?
VPS hosting explained: what is a Virtual Private Server, who is it suitable for and what are the advantages compared to shared hosting?
What is an SSL Certificate?
Everything about SSL certificates: what is SSL, why do you need it and how do you recognize a secure website? Essential for every website.
What is Uptime in Web Hosting?
What does uptime mean in web hosting? Learn about uptime percentages, SLA guarantees and why 99.9% uptime is important for your website.
How much storage do I need for my website?
Discover how much disk space you really need for your website. Practical guide with examples per website type.