Troubleshooting

Fix PHP max_input_vars exceeded (forms and menus not saving)

Fix the PHP warning Input variables exceeded 1000 and forms or WordPress menus that silently stop saving, by raising max_input_vars on cPanel, a VPS or with .user.ini.

BeginnercPanel hosting · Linux VPS2 min read

PHP accepts at most 1,000 input variables per request by default. A large form, a long WordPress menu, a WooCommerce product with many variations, or a theme options page can send more. PHP then silently drops the rest, so changes seem to save but part of them is lost.

Before you start

  • Look for this warning in the PHP error log: PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini.
  • If there is no warning, the symptom alone (menu items vanishing after save) is a strong hint.

Raise it on cPanel

  1. Open cPanel → Software → Select PHP Version → Options (CloudLinux), or MultiPHP INI Editor.
  2. Set max_input_vars to 5000, or 10000 for very large menus.
  3. Save, then repeat the action that failed.

See PHP version and options in cPanel.

Raise it with .user.ini

Where the panel does not offer the option, create .user.ini in the site's document root:

max_input_vars = 5000

PHP reads it within about 5 minutes (user_ini.cache_ttl). With mod_php, use php_value max_input_vars 5000 in .htaccess instead.

Raise it on a VPS

Edit the PHP-FPM php.ini for your version, for example /etc/php/8.3/fpm/php.ini:

max_input_vars = 5000
sudo systemctl restart php8.3-fpm

If you use a per-site pool, set php_admin_value[max_input_vars] = 5000 in that pool file instead.

Check that the change applied

Create a temporary phpinfo() page, check that the Local Value of max_input_vars shows the new number, then delete the page. In WordPress, Tools → Site Health → Info → Server also shows it.

Still losing data?

  • Suhosin, an old security extension, has its own suhosin.post.max_vars and suhosin.request.max_vars limits.
  • Large posts can also hit post_max_size. Related limits are covered in fix upload size limit errors and increase WordPress PHP limits.
  • A web application firewall rule can block very large requests. Check the ModSecurity or Imunify360 logs.

FAQ

What value should I use?

3000–5000 covers most sites. Use 10000 for very large menus or product variation pages. Avoid setting it extremely high, because the limit protects against hash-collision attacks.

Why do my WordPress menu items disappear after saving?

Each menu item sends about 10–12 fields, so a menu with around 90 items exceeds 1,000 variables. Raise max_input_vars and save the menu again.

Does max_input_vars apply to JSON or REST requests?

No. It only limits parsed form data (GET, POST and cookies). A JSON body is read as one raw input.

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.