Skip to content

Increasing PHP Memory Limit for WordPress

Updated 1 min read

Updated: 28 September 2026 · Applies to: WordPress 7.1

WordPress has its own memory setting in addition to PHP's memory_limit. Set it in wp-config.php (never in WordPress core files such as wp-settings.php, which updates overwrite).

Steps

  1. Open wp-config.php in the WordPress folder with cPanel's File Manager or FTP.
  2. Above the line /* That's all, stop editing! */, add:
    define( 'WP_MEMORY_LIMIT', '256M' );
  3. Save the file.

WordPress cannot use more than PHP allows, so also raise PHP's memory_limit if needed (see "How to fix the problem with PHP WordPress memory?"). Check the result under Tools › Site Health › Info.

Related services

Web hosting

shared hosting on Virtualmin with NVMe storage, free SSL and email.

Managed cPanel VPS

cPanel included; we handle updates, security and monitoring.

Hire an expert

engineers per 15 minutes, per hour or per month, with no contract.

Was this answer helpful?

Still stuck? Open a ticket