WP PHP max input vars is the maximum number of variables a server can use for a single function to avoid overloads. The default PHP max input vars is 1000. Low maximum input vars results in some issues related to your menus; menu items not saving successfully or the last entries are being truncated or left off. This often arises when installing a big demo for a theme with lots of menu entries.

How to increase WP max input vars

The recommended WordPress maximum input vars is 2000.

a. php.ini

  1. Locate the php.ini file. If you can not find it, then simply create your own php.ini file and place it in the root directory of your WordPress installation. If you have access to cPanel, the go to File Manager > public_html
  2. Locate the .php.ini file under the public_html folder, right click on it and select the ‘Edit’ option
  3. Locate the line that has; max_input_vars = 1000. If you created your own php.ini file, ensure you add the line
  4. Change the max input vars from 1000 to 2000
  5. Save the php.ini file then refresh your website

Note:

Many shared hosting providers restrict you from accessing the php.ini file. This method is only applicable in case you have direct access to your php.ini file or if you are running your WordPress on a local host.

b. .htaccess

  1. Locate the .htaccess file in the root directory of your WordPress installation. If you can’t find it then it might be hidden. Make sure to check your hidden files when locating it. If you have access to cPanel, the go to File Manager > public_html
  2. Locate the .htaccess file under the public_html folder, right click on it and select the ‘Edit’ option
  3. Locate the line that has; php_value max_input_vars 1000. If you can’t find that line, you can simply add it before the # END WordPress line
  4. Change the max input vars from 1000 to 2000
  5. Save the .htaccess file then refresh your website