If you see “Allowed memory size of … bytes exhausted”, WordPress ran out of PHP memory: you have hit the WordPress memory limit. Add define( 'WP_MEMORY_LIMIT', '256M' ); to wp-config.php above the “That’s all, stop editing” line. If that does not work, your host’s PHP memory_limit is lower and must be raised in php.ini, .user.ini or the hosting panel. If memory keeps running out, find the plugin or process using it rather than raising the limit indefinitely.
“Allowed memory size exhausted” means you have hit the WordPress memory limit: WordPress is telling you that a task needed more PHP memory than it was allowed. It often appears when uploading large images, running a heavy plugin, importing data or using a page builder on a big page.
Raising the memory limit usually fixes the immediate problem. But it is also worth finding out why so much memory is needed — sometimes a single plugin is the real culprit.
Memory errors can cause white screens, failed uploads and broken admin pages. This guide shows how to check and raise the limit safely.
Important: Take a backup before editing wp-config.php, .htaccess or the database — see how to back up WordPress.
Check your current WordPress memory limit
Go to Tools → Site Health → Info. Under “WordPress Constants” you will see WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT, and under “Server” the PHP memory limit.

Method 1: Edit wp-config.php
// wp-config.php — add above /* That's all, stop editing! */
define( 'WP_MEMORY_LIMIT', '256M' ); // front end
define( 'WP_MAX_MEMORY_LIMIT', '512M' ); // admin tasks such as image processing
Method 2: Raise the PHP memory_limit
WordPress cannot use more memory than PHP allows. Depending on your host, change it in:
- Your hosting panel’s PHP settings (for example “MultiPHP INI Editor” in cPanel)
- A
php.inior.user.inifile:memory_limit = 256M - .htaccess on some Apache setups:
php_value memory_limit 256M
Note: Many shared hosts cap memory per account. If you cannot change it, ask support or consider a plan with more resources.
Find what is using too much memory
- Read the errorThe message usually includes a file path pointing to a plugin or theme.
- Use Query MonitorThis plugin shows peak memory use per page.
- Test plugins on stagingDisable plugins one by one to find the heavy one.
- Check large imports or imagesHuge image uploads and imports need more memory temporarily.

For a complete diagnostic method, see our WordPress troubleshooting guide.
Typical memory needs
| Site | Typical memory_limit |
|---|---|
| Simple blog or brochure site | 128M is usually enough |
| Site with a page builder | 256M is common |
| WooCommerce or membership site | 256M–512M |
| Large imports or complex admin tasks | Higher temporarily, if the host allows |
These are common starting points; your host’s limits and your plugins determine what you actually need.
Reduce memory usage
- Remove unused plugins.
- Replace heavy plugins with lighter alternatives.
- Resize images before uploading.
- Split large imports into smaller batches.
- Keep PHP updated to a supported version.
Frequently asked questions
What is the default WordPress memory limit?
WordPress tries to set 40M for single sites and 64M for multisite, but your host’s PHP memory_limit decides the real maximum. Many hosts allow 128M or more.
How much memory does WordPress need?
Simple sites run well with 128M–256M. WooCommerce stores and sites with page builders often benefit from 256M–512M.
Why didn’t raising WP_MEMORY_LIMIT work?
WordPress cannot exceed PHP’s memory_limit. Raise the PHP limit in your hosting panel or php.ini, or ask your host.
Is it safe to increase the memory limit?
Yes, within your host’s resources. But if memory keeps running out, fix the plugin or process causing it.
Does more memory make WordPress faster?
Not directly. Memory only prevents errors when tasks need more. Speed depends on caching, hosting and code efficiency.
Can my host block memory increases?
Yes. Shared hosting plans often have maximum limits. Ask your host or upgrade if you consistently need more.
Where do I see memory errors?
In the browser as a fatal error, in recovery-mode emails or in the PHP error log or WordPress debug.log.
Further reading: the official WordPress documentation.







