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. If the value is too low, you may experience problems such as lost data within your Theme Options and disappearing widgets.
How to increase the PHP Max Input Vars
Most shared hosts won’t grant you full access to modify this value. Please contact your host first to find out if they can adjust it for you. This is a simple setting they can change without problems (they tend to keep it low by default to save their resources).
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 Method: 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 local host.
- 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, 3000.
- If you created your own PHP.ini file, then add the same code inside it:
max_input_vars = 3000; Simply change the value to the recommended value. For example, 3000.
- Save your changes, and reboot your local host or your server.
2 Method: edit the .HTACCESS file
NOTE: make sure to back up 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 3000
or the following if you have the suhosin security patch:
php_value suhosin.request.max_vars 3000
php_value suhosin.post.max_vars 3000
Simply change the value to the recommended value. For example, 3000.
- Save the file and refresh your website.
If you don’t have access to PHP.ini or .HTACCESS file
If you’re on shared hosting, you may not have access to the PHP.ini or .HTACCESS file, or it is possible that the changes are not applicable. In most cases, it is best to contact your host to have them change these values if you are not able to fix yourself.
PHP Max Input Vars (allowed)
If after correctly edited the PHP Max Input Vars value, the PHP Max Input Vars (allowed) still reports an error this could be due to two factors:
- Your server is limiting the Max Input Vars value: if the server applies a Master value, the effective Max Input Vars are limited upstream by this parameter (the server Master value has precedence over the installation Max Input Vars). We recommend to check with your host the Max Input Vars Master value.
- Your server installed the Suhosin library: Suhosin is a PHP library that can be used to improve from known and unknown flaws in PHP applications. Please verify with your host what is the Suhosin Max Input Vars since also this parameter can limit upstream the installation Max Input Vars.