WordPress Memory Limit Exhausted Error — Step-by-Step Fix (2025 Guide)
The “WordPress Memory Limit Exhausted” error is one of the most common problems website owners face. It usually appears as:
“Allowed memory size of 67108864 bytes exhausted…”
This error happens when WordPress tries to use more memory than your server allows.
In this guide, we’ll show you step-by-step how to fix this error and prevent it from happening again.
If your current host keeps hitting memory limits, migrating to eHost can solve the problem with fast, reliable hosting for South African websites.
What Causes the Memory Limit Exhausted Error?
- Too many plugins or themes using memory
- Large images or heavy scripts on pages
- Default PHP memory limit set too low on the server
- Poorly coded plugins or themes
- Shared hosting restrictions (common in South Africa)
💡 Tip: Regularly monitoring plugin performance helps prevent this error.
Step-by-Step Fix
Step 1: Increase PHP Memory Limit via wp-config.php
1. Connect to your website via FTP or File Manager
2. Open wp-config.php in your root folder
3. Add the following line above the “/* That’s all, stop editing! */” line:
define('WP_MEMORY_LIMIT', '256M');
4. Save the file and reload your website
Note: If your host limits memory, this may not work. See Step 2.
Step 2: Increase Memory via PHP.ini (cPanel)
1. Log in to cPanel → MultiPHP INI Editor
2. Select your domain
3. Set:
memory_limit = 256M
4. Save changes and reload the site
Many SA shared hosting accounts have lower defaults (64M or 128M). Increasing memory usually fixes the problem.
Step 3: Increase Memory via .htaccess
If you cannot access PHP.ini, add this line to your .htaccess file:
php_value memory_limit 256M
Works on most Apache servers but check your host if it causes a 500 error.
Step 4: Disable Problematic Plugins
1. If the error persists, disable all plugins via FTP → wp-content → plugins (rename folder)
2. Reactivate plugins one by one to find the culprit
3. Consider lighter alternatives or removing heavy plugins
Step 5: Switch to a Better Hosting Plan
If memory errors continue, it may be your server limits. eHost WordPress hosting offers:
- Increased PHP memory limits
- Optimized server resources for WordPress
- 24/7 support for troubleshooting
Preventing Memory Limit Errors in the Future
- Limit the number of heavy plugins
- Optimize images and scripts
- Use caching and optimization plugins
- Choose hosting optimized for WordPress
- Monitor server resource usage
FAQ
Q: How much memory is enough for WordPress?
256M is usually sufficient for most small to medium websites. Large WooCommerce sites may need 512M or more.
Q: Can this error break my website?
Yes — the site may crash or show a white screen. Increasing memory usually fixes it immediately.
Q: Can I fix this without technical knowledge?
Yes — editing wp-config.php or using cPanel tools is enough for most users.
Need Help With WordPress Hosting?
If you keep running into memory errors, migrate your WordPress site to eHost. Our South African hosting offers:
- Fast, reliable WordPress hosting
- Increased PHP memory and server resources
- Free site migration
- 24/7 support for WordPress errors
Don’t let memory limits slow down your website — switch to eHost today.