Tech Stuffs

Increasing PHP Limits for WordPress

Increasing PHP Limits for WordPress

One of the most common requests I get from clients is helping them with increasing various PHP limits on their WordPress sites, so goes a post that I can share with them when needed!

These directives can be set either on your .htaccess, php.ini, .user.ini, or wp-config.php file. They will work on non-WordPress sites as well, as long as they are PHP powered.

PHP Memory Limit

Maximum amount of memory in bytes that a script is allowed to allocate.

.htaccessphp_value memory_limit 128M
php.ini / .user.inimemory_limit=128M
wp-config.phpdefine('WP_MEMORY_LIMIT', '128M');

The minimum recommended limis is 128M.

PHP Max Execution Time

Amount of time in seconds that your site will spend on a single operation before timing out to avoid server lockups.

.htaccessphp_value max_execution_time 300
php.ini / .user.inimax_execution_time=300
wp-config.php@ini_set( 'max_execution_time' , '300' );

The minimum recommended size is 300.

PHP Max Upload Size

Largest file size that can be uploaded to your WordPress installation.

.htaccessphp_value upload_max_filesize 32M
php.ini / .user.iniupload_max_filesize=32M
wp-config.php@ini_set( 'upload_max_size' , '32M' );

The minimum recommended size is 32M

PHP Max Post Size

Maximum size for all POST body data.

.htaccessphp_value post_max_size 32M
php.ini / .user.inipost_max_size=32M
wp-config.php@ini_set( 'post_max_size' , '32M' );

The minimum recommended size is 32M.

PHP Max Input Vars

Maximum number of variables your server can use for a single function to avoid overloads.

.htaccessphp_value max_input_vars 4000
php.ini / .user.inimax_input_vars=4000
wp-config.php@ini_set( 'max_input_vars' , 4000 );

The minimum recommended limit is 4000.

If you don’t feel comfortable in trying the above methods, or if they didn’t work for you, then you need to contact your hosting company support.

Leave a Reply