Some WordPress plugins, themes or admin tasks may need more memory than WordPress is currently allowed to use.
This can happen with larger WooCommerce sites, page builders, imports, backups or plugin updates.
You can ask WordPress to use more memory by editing the wp-config.php file. This only works if the PHP memory limit on the hosting account is high enough to allow it.
Take a backup before editing wp-config.php.
- Log in to cPanel.
- Open File Manager.
- Open the folder where WordPress is installed.
- Find the
wp-config.phpfile. - Right-click the file and choose Edit.
- Find the line that says:
/ That's all, stop editing! Happy publishing. /
- Add the following lines above it:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
- Save the file.
- Reload the site or WordPress dashboard and check whether the error has cleared.
WP_MEMORY_LIMIT applies to normal WordPress requests. WP_MAX_MEMORY_LIMIT applies to WordPress admin tasks.
If the hosting account’s PHP memory limit is lower than the value you set in wp-config.php, WordPress will not be able to use the higher value.
Increasing the memory limit can help when WordPress genuinely needs more memory, but it does not fix every problem. If the error keeps coming back, a plugin, theme or script may be using too much memory and should be checked properly.
If you are unsure what memory limit is available on your hosting plan, open a support ticket and we can check it for you.