Home › Forums › Backend Issues (wp-admin) › PHP: Input variables exceeded 1000
While trying to edit a field group, I noticed that my changes were not being saved. When I looked at the web server logs I saw entries like this…
AH01071: Got error 'PHP message: PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0\n'
So I enabled the developer tools on my web browser and examined the contents of the post. Sure enough, there was easily over 1000 variables being posted (it is a field group with a lot of stuff in it).
Conditions causing the bug:
I bumped the php.ini variable ‘max_input_vars’ up to 2000, restarted apache, reconstructed the field group and was able to save it. So too many form variables being submitted at once is definitely causing the problem. Luckily, everything that used that field group was restored to normal operation after reconstructing the field group. Then I returned ‘max_input_vars’ to its default value of 1000 and restarted apache again to prevent attackers from trying to abuse GET and POST requests.
It is my understanding that WordPress is moving toward using its REST-API for all screens in the admin area. Maybe now is a good time to start converting ACF to submit all data from the field group editor as a single JSON data string. This would avoid triggering the default 1000 input variable setting on apache.
As far as I know the only solution currently is to increase max_input_vars and leave it.
The developer may focus on this in the future, but I don’t have this information. The best way for you to get his attention is here https://www.advancedcustomfields.com/contact/
Yes, I figured out later that the developers don’t really follow this forum, so I filled out a trouble ticket with my suggestion solution. The answer i got back was that the person answering the trouble ticket would pass my JSON data idea on to the developers.
Hope this helps others, but for every WP site I set max_input_vars to 5000. Since then I have run dozens of sites and some with massive amounts of repeaters and other fields. So far I have not run into this issue again.
You can do this with Apache or Nginx (Whatever web server you are using) or PHP.ini.
The developer took my advice. All versions since 5.0 no longer have this problem.
You can change your max_input_vars setting back to the default value of 1000, and ACF will work fine with large field sets.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We’re hard at work on ACF 6.1, and Beta 1 is now available 🚀— Advanced Custom Fields (@wp_acf) March 16, 2023
This release includes custom post type and taxonomy registration, an improved experience when selecting field types, PHP 8.1 and 8.2 compatibility, and more!
Let’s take a look 🧵https://t.co/Y0WcAT11l4
© 2023 Advanced Custom Fields.