Raise the WordPress memory limit
WordPress and PHP each have a memory limit. If a page needs more, you see "Allowed memory size of 268435456 bytes exhausted" or a plain error page. Raising the limit usually fixes it.
Two limits
| Limit | Set in | Controls |
|---|---|---|
PHP memory_limit |
Your Barbrick account | The hard cap for a PHP process |
WP_MEMORY_LIMIT |
wp-config.php |
What WordPress asks for, up to the cap |
Raise the PHP one first. WordPress can't use more than PHP allows.
Step 1: PHP memory limit
- Open Account → Hosting → your site → Performance → Choose PHP for each site.
- On your site's card, open PHP settings and set Memory per request to
512M. - Click Save. Changes take effect in a few seconds.
See Change PHP settings. You can go as high as 1G on any plan, but your plan's account memory still caps what a request can use.
Step 2: WordPress limit
Edit wp-config.php in Files. Add above /* That's all, stop editing! */:
// Memory for front-end and admin pages
define( 'WP_MEMORY_LIMIT', '256M' );
// Larger limit for wp-admin tasks (imports, updates)
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
Check
In wp-admin, open Tools → Site Health → Info → Server. Look at PHP memory limit.
If it keeps happening
Raising memory hides the cause. Look for:
- A plugin with a leak. See Find a plugin causing problems.
- Huge image uploads. Resize before uploading.
- An import or page builder on a large page.
Memory is limited by your plan's resource limits. If your site constantly hits them, see Resource limits explained.
If something goes wrong
- No change: PHP-FPM can take a minute. Clear LiteSpeed Cache and recheck.
- 500 error: a value was typed wrongly. Use
256M, not256 MB.
Still stuck? Ask us and we'll walk you through it.
