Recommended PHP Configuration Resource Limits for WordPress

Are your WordPress pages breaking for no clear reason? In most cases, low PHP configuration limits for WordPress are the cause. When your server runs out of memory or execution time, WordPress simply stops, and you end up with broken pages.

Common problems linked to low limits include:

  • The White Screen of Death
  • Demo content import failures
  • Empty or blank page content
  • Theme skin or customizer changes that won’t save

Fortunately, you can fix all of these by raising a few key values. Below are the recommended settings.

First, if you have server access, add or update these values in your php.ini file. These are the official WordPress hosting requirements that most themes and plugins expect:

; Maximum execution time of each script, in seconds
max_execution_time = 180

; Maximum time each script may spend parsing request data
max_input_time = 60

; Maximum input variable nesting level
max_input_vars = 3000

; Maximum memory a script may consume
memory_limit = 256M

; Maximum size of POST data PHP will accept
post_max_size = 64M

; Maximum allowed size for uploaded files
upload_max_filesize = 64M

However, most shared hosts will not give you full access to php.ini, because it affects every site on the server. Therefore, contact your host first and ask them to adjust these values for you.

Setting PHP Configuration Limits for WordPress in wp-config.php

If you cannot edit php.ini, you can set these PHP limits directly. Simply open wp-config.php in the root of your WordPress directory with a text editor such as Notepad++. Then add the following lines just after define('WP_DEBUG', false);:

set_time_limit(300);
@ini_set( 'max_input_time', '60' );
@ini_set( 'max_input_vars', '3000' );
define( 'WP_MEMORY_LIMIT', '256M' );
@ini_set( 'post_max_size', '64M' );
@ini_set( 'upload_max_filesize', '64M' );

Next, save the file and reload your site. In most cases, the errors will disappear right away. If they continue, increase memory_limit to 512M and try again.

How to Confirm Your New Settings

After saving, go to Tools > Site Health > Info > Server in your WordPress dashboard. There you can confirm the active memory limit, upload size, and execution time. If the values still show the old numbers, your host is likely overriding them, so reach out to their support team.

Note: Some managed hosts ignore wp-config.php overrides. If your limits still won’t change, ask your host to update the server configuration instead.