WordPress is a powerful content management system, but as your website grows and starts using more plugins, themes, or handles heavier traffic, you might encounter a common error: “Allowed memory size of x bytes exhausted.” This happens when your site exceeds the allocated WordPress memory limit — the maximum amount of memory PHP scripts are allowed to use. Fortunately, there’s a straightforward fix: increasing the memory limit to ensure smooth and stable performance.
Why Increase the WordPress Memory Limit?
WordPress relies on PHP to run, and like any software, it needs memory to function efficiently. The default memory limit on many hosting providers is 32MB or 64MB, which can be too low for complex sites using resource-intensive plugins like WooCommerce, Elementor, or WPML.
Common symptoms of a low memory limit include:
- White screen of death (WSOD)
- Inability to upload media
- Admin panel errors
- Plugin/theme installation failures
Increasing the memory limit can resolve these issues and improve overall site stability.
How to Check Your Current WordPress Memory Limit
Before increasing the limit, check what’s currently allocated. You can do this by:
Using a plugin like “Site Health” or “WP Memory Usage.”
Viewing your
phpinfo()file:Create a new
.phpfile (e.g.,info.php) and insert:
- Upload it to your root directory and visit
yourdomain.com/info.php - Look for
memory_limitin the output.
How to Increase the WordPress Memory Limit
There are several methods to increase your memory limit. Choose the one that suits your hosting environment.
1. Edit wp-config.php
This is the recommended method for most WordPress users.
- Open your site’s root directory via FTP or File Manager.
- Locate and open
wp-config.php - Add this line just before
/* That's all, stop editing! */:
define('WP_MEMORY_LIMIT', '256M');
- Save the file.
If you’re on the admin side and want to allocate more memory just for that, you can also add:
define('WP_MAX_MEMORY_LIMIT', '512M');
Note: WP_MEMORY_LIMIT is for frontend usage, while WP_MAX_MEMORY_LIMIT is used in the admin dashboard.
2. Modify php.ini (if available)
For VPS or dedicated hosting environments:
- Locate your
php.inifile (ask your host if unsure). - Find or add this line:
memory_limit = 512M
3. Edit .htaccess
If you can’t access php.ini, try modifying .htaccess (Apache servers only):
Add this line:
php_value memory_limit 512M
Important: Some shared hosts don’t allow memory changes via .htaccess and may return a 500 error.
4. Contact Your Hosting Provider
If none of the above methods work or you’re on a shared server, reach out to your hosting provider and request a higher memory allocation.
What Is the Maximum WordPress Memory Limit?
Technically, there’s no strict “maximum” memory limit, but it depends on:
- Your server’s total available RAM
- Hosting plan restrictions
- PHP version (some versions cap memory by default)
Recommended limits:
- Small blogs: 128M
- Medium to large sites or WooCommerce stores: 256M to 512M
- Heavy resource sites or custom applications: 512M to 1024M+
Setting memory to 512M is usually sufficient for most large sites, and 1024M (1GB) is an upper bound for very demanding setups.
Final Thoughts
Increasing the WordPress memory limit is a simple but powerful tweak that can prevent errors, boost performance, and improve the admin experience. Whether you’re running a personal blog or a busy eCommerce store, ensuring your site has enough memory is essential for smooth operation.
Always remember to back up your site before making any changes, and if you’re unsure, ask your hosting support for assistance. Your website’s performance — and your peace of mind — will thank you.


