Skip to main content
If you see “Allowed memory size exhausted” errors or your WordPress dashboard feels slow, you may need to increase the memory available to WordPress. This is separate from the PHP memory_limit setting. WordPress has its own cap defined in wp-config.php.

Edit wp-config.php

1

Open File Manager

Log in to cPanel through your client area or at yourdomain.com/cpanel. Go to Files and click File Manager.
2

Find wp-config.php

Navigate to your WordPress installation’s root folder. For your main domain, this is usually public_html. Select wp-config.php and click Edit.
3

Add the memory limit line

Find the line that reads:
/* That's all, stop editing! Happy publishing. */
Add this line directly above it:
define( 'WP_MEMORY_LIMIT', '512M' );
4

Save

Click Save Changes.
You can set the value to whatever your hosting plan allows. Check your plan’s memory allocation on the resource limits page.
Setting WP_MEMORY_LIMIT higher than your hosting plan’s actual memory limit has no effect. WordPress can only use up to the limit allocated to your cPanel account.
If you also need to increase the PHP-level memory_limit (which caps all PHP scripts, not just WordPress), you can do that in the PHP Selector.