Advertisement
Skip to content

Menu won’t save: raise max_input_vars, then verify with phpinfo

By Published 12 min read

On this page (8 sections)
  1. The short version
  2. Why WordPress menus won't save past a certain size
  3. Where max_input_vars can actually be set: and which files your host ignores
  4. How to confirm PHP is running the new value, not just the file you edited
  5. How to count your menu's POST fields before you re-save
  6. What to do when the host won't raise max_input_vars high enough
  7. How to stop the menu save problem coming back
  8. Questions people still ask

In short: WordPress menus fail to save when the number of POST fields they generate exceeds PHP's max_input_vars limit, which defaults to 1000. Raise the limit in the correct config file for your server type, verify with phpinfo that PHP is actually running the new value, then re-save once.

Part of our guide on web page slowdown on shared hosting

Most guides tell you to edit .htaccess — but on managed WordPress hosts running PHP-FPM, that file is silently ignored and the menu keeps breaking.

At a glance
PHP default limit1000 input vars
POST fields per menu itemroughly 10-13 fields each
Safe raised limit3000-5000 for large menus
Verify methodphpinfo() or Site Health tab
.htaccess works on FPM?No — ignored silently
Save attempts neededOne, after confirming limit

The short version

  • Each menu item generates roughly 10-13 POST fields; a 100-item menu can hit the 1000 default on its own.
  • On PHP-FPM or managed hosts, only.user.ini or the FPM pool file will work:.htaccess changes do nothing.
  • Always verify with a phpinfo page or Site Health after editing any config file; never assume the file was read.
  • Check your PHP error log for 'max_input_vars' warnings before concluding a plugin or theme is at fault.
  • If your host caps the value below what your menu needs, splitting the menu is the only reliable fallback.

Why WordPress menus won't save past a certain size

PHP limits the number of POST fields it will process in a single request. The default is 1000. Any fields beyond that are silently dropped.

A WordPress menu doesn't send one field per item. It sends a structured block: item ID, parent, order, label, URL, target, CSS class, description, title attribute, and a nonce check. That's roughly 10-13 fields per item. A menu with 85 to 100 items can hit the ceiling on its own.

The save request appears to succeed. WordPress shows no error. The menu just reverts to the last saved state, or the extra items disappear. That silence is the giveaway: a real plugin or theme error usually produces a notice, a white screen, or a console message. A truncated POST produces nothing.

Widgets and custom fields share the same POST budget. A page with many widgets saved at once, or a post with dozens of custom fields, can trigger the same cut-off for the same reason. We go through keeping visitors from seeing downtime step by step elsewhere on the site.

  • Navigation menu items: 10-13 POST fields each, so 80+ items approaches the 1000 default.
  • Widget blocks: each widget area sends several fields; a sidebar with 15 widgets can add 100+ fields.
  • Custom fields: each meta key-value pair is two fields minimum; heavy page builders multiply this fast.
  • Theme customizer: some themes submit the full customizer state in one POST – dozens of panels at once.

Where max_input_vars can actually be set: and which files your host ignores

WordPress navigation menu builder screen with long list of menu items
WordPress navigation menu builder screen with long list of menu items

PHP reads its configuration from a stack of files. The one that wins depends entirely on how PHP runs on your server. Edit the wrong file and nothing changes.

The classic approach (adding php_value max_input_vars 3000 to .htaccess) only works when PHP runs as an Apache module (mod_php). Most modern hosts, and almost every managed WordPress host, run PHP as PHP-FPM. Apache passes requests to a separate PHP process. That process never reads .htaccess. Your edit is ignored without any error message.

On PHP-FPM setups, the winning files are the global php.ini, the FPM pool config (usually /etc/php/8.x/fpm/pool.d/www.conf), or .user.ini in your site's document root. The .user.ini file is the one ordinary hosting accounts can usually write to. FPM re-reads it at an interval set by user_ini.cache_ttl, typically 300 seconds, so your change won't take effect instantly. It helps to understand wordpress 2mb upload limit fix before going further.

Some managed hosts (WP Engine, Kinsta, Flywheel) block direct edits to all of these and expose a PHP config panel in their dashboard instead. Others hard-cap max_input_vars at a value you cannot override without contacting support. Know your host before spending time editing files.

Config file vs server type — which one PHP actually reads
File or locationWorks on mod_phpWorks on PHP-FPMNeeds root access
.htaccess (php_value)YesNo — silently ignoredNo
.user.ini (in docroot)SometimesYes — after cache_ttlNo
Global php.iniYesYesUsually yes
FPM pool conf (www.conf)NoYesYes
Hosting dashboard panelDepends on hostDepends on hostNo

How to confirm PHP is running the new value, not just the file you edited

Editing a file proves nothing on its own. You need to confirm the running PHP process has picked up the change. The only way to do that is to ask PHP directly.

Create a temporary file in your WordPress root: call it phpcheck.php. Its entire content is <?php phpinfo();?>. Open it in a browser. Search the output page for max_input_vars. You will see two columns: Local Value and Master Value. The Local Value is what actually applies to your requests. If it still shows 1000, PHP did not read your edit. It helps to understand fixing wordpress admin page errors before going further.

WordPress Site Health is a less reliable alternative. Go to Tools > Site Health > Info > Server. It lists PHP settings, but it reflects the value PHP reports at request time for that page. It is usually accurate, but phpinfo in a standalone file removes any WordPress-layer uncertainty.

Delete phpcheck.php immediately after checking. A live phpinfo page exposes your PHP version, loaded extensions, server paths, and environment variables to anyone who finds it. It is a real information-disclosure risk.

  1. Create a file named phpcheck.php in your WordPress root containing exactly: <?php phpinfo(); ?>
  2. Visit yourdomain.com/phpcheck.php in a browser while logged out of WordPress.
  3. Use Ctrl+F to search the page for 'max_input_vars'.
  4. Read the Local Value column. That is the number PHP will enforce on your menu save request.
  5. If Local Value still shows 1000, your edit was not read: check that you edited the correct file for your server type.
  6. Delete phpcheck.php from the server as soon as you have confirmed the value.

How to count your menu's POST fields before you re-save

Terminal window showing php.ini file open with max_input_vars line highlighted
Terminal window showing php.ini file open with max_input_vars line highlighted

Raising the limit to 3000 and re-saving once is not the same as confirming truncation was the problem. Count first, then save. People in this spot often ask about diagnosing ttfb spikes post publish as well.

Open your browser's developer tools before you click Save Menu. Go to the Network tab. Save the menu. Find the POST request to admin-ajax.php or the nav-menus.php action. Click it and look at the Form Data or Payload section. Each menu-item-* entry is one field. Count them, or use the browser's search to count instances of menu-item-db-id.

A rough formula: multiply your visible menu item count by 12. That gives an estimate. The developer tools count is exact. If your count exceeds your current max_input_vars value, that is your cause confirmed. If it comes in well under 1000, the menu issue is something else entirely: a nonce timeout, a caching conflict, or a plugin intercepting the save.

Check the PHP error log at the same time. On shared hosting this is often in public_html/error_log. On cPanel it appears under Error Logs. The entry looks like: PHP Warning: Unknown: Input variables exceeded 1000. That warning appearing at the timestamp of your save attempt is the definitive confirmation. We cover smush fails webp conversion after image upload in its own article.

What to do when the host won't raise max_input_vars high enough

Some shared hosts cap max_input_vars at 1000 or 1500 and will not raise it further. That is a real constraint. No amount of file editing will get past a hard server-level cap.

The practical fix is to split the menu. WordPress allows multiple registered navigation menus. Create a second menu for the overflow items (typically a secondary footer nav or a utility menu) and assign it to a separate theme location. Your theme may already register two or three nav slots. This keeps each individual menu's POST footprint under the cap.

If splitting the menu doesn't suit your site structure, moving to a host that exposes PHP configuration controls is the cleaner long-term answer. Hostinger's shared and managed WordPress plans let you adjust PHP settings through hPanel, which removes the guesswork about which layer wins. It won't solve every host-side cap situation, and it's not a reason to switch hosts if the split-menu approach handles your needs: but if you're hitting config walls on multiple fronts, a host with direct PHP controls is worth considering.

A WP-CLI command can help count menu items before you rebuild: wp menu item list --menu=main-menu --fields=ID,title | wc -l. That gives a quick item count without opening the admin at all. Pair it with your max_input_vars value and you'll know immediately whether a split is needed.

  • Split the menu: move lower-priority items to a secondary nav location already registered by your theme.
  • Use a mega menu plugin: some restructure the save request so fewer fields post at once – verify this claim for each plugin before relying on it.
  • Contact host support: ask for the exact cap and whether a VPS or higher-tier plan removes it.
  • Move to a host with PHP config access: a last resort if the cap affects multiple aspects of your site.
What works
  • Split menu: free, immediate, no server change needed
  • Host with PHP controls: permanent fix, no menu restructure
What to watch
  • Split menu: may require theme template edits
  • Switching hosts: takes time, involves migration risk

How to stop the menu save problem coming back

Browser window showing phpinfo output page with max_input_vars row visible
Browser window showing phpinfo output page with max_input_vars row visible

A raised limit stays raised only as long as the config file isn't overwritten. Some hosts reset .user.ini when they push platform updates. Keep a copy of your edits outside the server.

Add a permanent check to your workflow. The Site Health tab under Tools shows the current PHP values every time you open it. Bookmark it. If max_input_vars has reverted to 1000, you'll see it before you try to save a menu and lose work.

Menu complexity grows over time. Add items gradually and re-count the POST fields periodically using the developer tools method above. Set a personal ceiling at 80% of your configured limit: if max_input_vars is 3000, start splitting menus when item count approaches 200. That buffer covers nonce fields, hidden inputs, and any plugin that adds its own POST fields to the same request.

Document the change in a site notes file. Record which file you edited, what value you set, the date, and the PHP version running at the time. When you or a future developer upgrades PHP, they'll know what to re-check. That two-minute note prevents a future hour of diagnosis.

  1. Keep a local copy of your.user.ini or the lines you added to php.ini: hosts can overwrite these on updates.
  2. Bookmark Tools > Site Health > Info > Server and check max_input_vars any time menu saves become unreliable.
  3. Set a personal item ceiling at 80 percent of your configured limit and split menus before you reach it.
  4. After any PHP version upgrade, run the phpcheck.php verification again to confirm the value carried over.
  5. Log your config change (file path, value, date, PHP version) in a plain text file stored with your site notes.

Questions people still ask

Does wp-config.php have a setting for max_input_vars?

No. wp-config.php is a PHP file, not a PHP configuration file. You cannot set INI directives in it the same way. Some tutorials suggest using ini_set('max_input_vars', 3000) inside wp-config.php, but max_input_vars is a PHP_INI_PERDIR directive: ini_set cannot change it at runtime. The only effective locations are php.ini,.user.ini, an FPM pool conf, or a hosting panel.

How do I know whether my host runs mod_php or PHP-FPM?

Create a phpinfo page and search for 'Server API'. If it says 'Apache 2.0 Handler', that is mod_php and .htaccess edits will work. If it says 'FPM/FastCGI', your host runs PHP-FPM and .htaccess edits for PHP values are silently ignored. Use .user.ini or the hosting dashboard instead.

Can a caching plugin cause the same 'menu reverts' symptom?

Yes, and it's a common misdiagnosis. A full-page cache can serve a stale version of the admin page after a successful save, making the menu appear to revert when it actually saved correctly. Clear all caches and reload the Menus page in a fresh incognito window. If the saved state is correct there, the problem was cache, not max_input_vars.

What value should I actually set max_input_vars to?

There is no universal correct number. A common safe raise is 3000, which covers most WordPress setups with large menus, multiple widget areas, and a page builder running on the same request. Very heavy page builders or sites with large custom field sets may need 5000. Avoid setting it unreasonably high: 10000 is not safer than 5000, and very large values can mask other problems.

Will raising max_input_vars slow down my site?

Not in any measurable way for ordinary WordPress use. The setting controls how many fields PHP will accept, not how much memory or CPU it uses per field. The performance cost of parsing a few thousand POST fields is negligible compared with database queries and plugin execution. Set it to what your site needs and don't worry about it.

My menu saved but some items are in the wrong order. Is that also a max_input_vars problem?

Possibly. Menu order is encoded in POST fields too. If those fields were truncated, items near the end of the menu structure may be dropped or reordered to defaults. Raise the limit, verify with phpinfo, and re-save with all items in their intended order. If the disorder persists after a confirmed-good limit, check whether a caching or autosave plugin is interfering.

I'd set max_input_vars to 3000 in.user.ini, verify the Local Value in phpinfo before touching the menu, and keep a plain-text note of the edit: that one habit has saved me from repeating the diagnosis after every PHP upgrade.