Increase max_input_vars
The max_input_vars is the number of variables that your website can use to run a function.
You may already know this, but if someone gets an error similar to "PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini" this will help set that to a higher value to be able to run all the variables that are needed.
The directive can be set in .htaccess
, php.ini
, .user.ini
or wp-config.php
file. To gain access to these files you will need FTP credentials. If you do not have these please contact your hosting provider.
Before you change all of those files we suggest you update your website to the latest version of PHP. This is because some older versions of PHP will limit the max_input_vars to something like 1000, even if you specify a higher number. We always suggest you use the latest stable version of PHP available at PHP.net. You can also check to see what version your hosting company offers and use the latest version they offer, as they may not always offer the latest that PHP.net offers as they have to test it first.
Here is how to increase the max_input_vars value:
- In your WordPress root installation locate these files:
.htaccess
,php.ini
,.user.ini
orwp-config.php
- Edit the file and paste the directive code
- Once you are done making changes save the file. If you have downloaded the file to make this change, upload it back to your server and override the existing file.
Directive for .htaccess
php_value max_input_vars 2500
Directive for php.ini or user.ini
max_input_vars=2500
Directive for wp-config.php
@ini_set( 'max_input_vars' , 2500);
The minimum recommended limit is 2500. Therefore if your website has a higher value then keep it that way, if not then we suggest using 2500.