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
- Locate the php.ini file. If you cannot find it, then simply create your own php.ini file and place it in the root directory of your WordPress installation. Using cPanel or FTP/SFTP, go to File Manager > public_html.
- Locate the .php.ini file under the public_html folder, right click on it and select the “Edit” option.
- Locate the line that has; max_input_vars = 1000. If you created your own php.ini file, ensure you add the line.
- Change the max input vars from 1000 to 2000.
- Save the php.ini file then refresh your website.
Some 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
- 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. Using cPanel or FTP/SFTP, go to File Manager > public_html.
- Locate the .htaccess file under the public_html folder, right click on it and select the “Edit” option.
- 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.
- Change the max input vars from 1000 to 2000.
- Save the .htaccess file then refresh your website.