Max Input Vars Error

You are here:

If you’re building a very large Quiz with lots of questions, answers or personalities/feedback entries, you might come across the error message ‘max_input_vars 1000’. The plugin might alert you when this will happen, to prevent data being lost.

The PHP variable “max_input_vars” was introduced in PHP 5.3.9+ as a security measure to limit the maximum amount of POST variables submitted, by default this limit is set to 1000. The quiz is built inside the WordPress Custom Post Type interface, which already includes a few hidden fields to control things like the publish date, publish status, author, and other types of information. The quiz itself can have a lot of hidden fields also, to control the order of the questions and answers, store image data, layout options, and so many other things. If you’re building a large quiz there’s a chance the number of data entries sent to be saved exceeds 1000.

The solution might not be the same for everyone, it will depend on your hosting also. Below we’ll cover the most popular solutions.

.htaccess Solution

Create or update your .htaccess file and add the following line:

php_value max_input_vars 3000

Your hosting provider may not allow this to be overridden, if this doesn’t work then try one of the following options or check with your provider.

Edit your php.ini file

If you have access to your servers php.ini file (via cPanel or any other options panel, using the file browsing interface) you can open it and change the value manually. You should check if that line already exists or add it:

max_input_vars = 3000

You can check in your hosting provided knowledge base if they allow you to modify this file and how to access it.

 

Was this article helpful?
Dislike 1