Skip to content
Knowledge Base

Raise the PHP memory limit and upload size

Page builders, the Customizer, and demo imports need more PHP resources than a basic blog. Low server limits show up as errors or blank screens, not as a clear message about the limit.

  • A white screen when you save in the Customizer, Elementor, or WPBakery.
  • An error such as “Allowed memory size of 134217728 bytes exhausted”.
  • “The uploaded file exceeds the upload_max_filesize directive in php.ini.”
  • The theme ZIP upload fails or stops with “The link you followed has expired.”
  • A demo import stops halfway.

Open Tools → Site Health → Info. Expand Server to see PHP memory limit, Upload max filesize, PHP post max size, and PHP time limit. Expand WordPress Constants to see WP_MEMORY_LIMIT.

SettingValue
WP_MEMORY_LIMIT256M
upload_max_filesize64M
post_max_size64M or higher
max_execution_time300

post_max_size must be at least as large as upload_max_filesize.

Take a backup and change one file at a time. A typo in these files can take the site down until you undo it.

  1. wp-config.php: add this line above /* That's all, stop editing! */:

    define( 'WP_MEMORY_LIMIT', '256M' );

    WordPress cannot go above the server’s own PHP memory_limit. If Site Health still shows the old value, the server limit is lower.

  2. php.ini or .user.ini: many hosts read a .user.ini file in the site’s root folder. Add:

    memory_limit = 256M
    upload_max_filesize = 64M
    post_max_size = 64M
    max_execution_time = 300

    Changes in .user.ini can take a few minutes to apply.

  3. .htaccess: only on Apache servers that run PHP as a module. Use php_value upload_max_filesize 64M and similar lines. On other setups this causes a 500 error, so remove the lines if the site breaks.

  4. Hosting control panel: most hosts offer a PHP settings or “PHP options” screen. This is the safest route when it exists.

Reload Site Health → Info to confirm the new values.

Contact your host when the values do not change, when you cannot edit these files, or when you are on managed hosting that controls PHP settings. Tell them the values above and the exact error you see. If the limits are already high and the problem continues, ask them to check the PHP error log.

For media files that are too large, see image upload size limit.