Raise the WordPress memory limit

memory, wp_memory_limit, php.ini, error, wp-config · 0 found this helpful

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

  1. Open Account → Hosting → your site → Performance → Choose PHP for each site.
  2. On your site's card, open PHP settings and set Memory per request to 512M.
  3. Click Save. Changes take effect in a few seconds.
PHP for each site. Memory per request is under PHP settings

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:

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, not 256 MB.

Was this helpful?

Still stuck? Ask us and we'll walk you through it.