The PHP Max Input Vars is the maximum number of variables your server can use for a single function. To work properly with a modern WordPress theme set this value to 3000. Lower values can create problems such lost data in your Theme Options, Widgets disappear etc. A common issue that may occur with a low max input vars in menu items not saving.
How to increase the PHP Max Input Vars
Like the other values above, you’ll need to access and modify either the php.ini or the .htaccess files. Most hosts won’t grant you full access to modify the PHP.ini file because it affects the whole server and all the websites hosted on it.Please contact your host first to find out if they can adjust it for you.
For advanced users who have their own server setups and full access to the php.ini file, please go ahead and try Method 1 first before the other method. For standard users, we encourage you to try Method 2 instead.
1. Edit the PHP.ini file
NOTE: many shared hosts prohibit you from having direct access to the PHP.ini file. Only do this method if you have direct access to your PHP.ini file or if you’re on your localhost.
- Locate your PHP.ini file. If you can’t find it, then you can create your own PHP.ini file in the root folder of your WordPress installation.
- If you find your existing PHP.ini, open the file and locate the following line of code (xx represents a number):
max_input_vars = xx; And set it to your desired limit. For example, 5000.
- If you created your own PHP.ini file, then adds the same code inside it:
max_input_vars = 5000Simply change the value to the recommended value. For example, 5000.
- Save your changes, and reboot your localhost or your server.
2. Edit the .HTACCESS file
NOTE: make sure to backup your .htaccess file before editing.
- Locate your .htaccess file which is usually in the root folder of your WordPress installation. If you can’t find it, it may be because it’s hidden. Here’s a tutorial for Windows and a tutorial for Mac on how to reveal hidden files on your computer.
- Open the .htaccess file with a text editor program (Notepad or TextEdit) and add the following line of code:
php_value max_input_vars 5000. Simply change the value to the recommended value. For example, 300.
- Save the file and refresh your website.