You add one more page to a menu in Appearance > Menus, click Save Menu, and instead of the usual “has been updated” notice you get a plain white page: Bad Request. Your browser sent a request that this server could not understand. From then on every save fails, even with no changes.
That page is not a WordPress error. Apache (or a firewall in front of it) rejected the request before PHP ran, so debug.log stays empty and turning plugins off usually changes nothing. This is exactly what people in a WordPress.org support thread from this week hit on shared hosting with Apache and PHP 8.4.
Below I go through the causes in the order I would check them: cookies, the host’s web application firewall, request size limits, and last max_input_vars.
Step 1. Rule out cookies with a private window
Apache limits the size of each request header. The default LimitRequestFieldSize is 8190 bytes, and the Cookie header is the one that grows over time as plugins, analytics and A/B tools add their own cookies.
Log in from a private/incognito window, or a browser you never used on that site, and save the menu again. Clearing the browser cache does not clear cookies, so that test proves nothing.
If the save works in the private window, delete the cookies for your domain in the normal browser and you are done. If it fails there too, the problem is on the server and you can move on.
Step 2. Save a tiny test menu
Create a new menu with a single page in it and save it. This one test splits the problem in two:
- The small menu saves, the big one does not: the size or content of the big menu triggers something. Go to Step 4.
- Even the one-item menu fails: a firewall rule is blocking every POST to
nav-menus.php. Go to Step 3.
If you use WP-CLI, this shows how many items each menu has:
wp menu list --fields=term_id,name,count
You get one row per menu, with the number of items in the count column.
Step 3. Find the firewall rule that blocks nav-menus.php
When a menu saved fine an hour ago and nothing changed on your side, a security rule update on the host is the most likely cause. ModSecurity and similar WAFs inspect the POST body, and a menu save is a big form full of URLs, titles and HTML-like values, which is exactly what injection rules look at.
If you have SSH and root, find the failed request first. Paths differ per distro; these are the Debian/Ubuntu defaults:
grep "nav-menus.php" /var/log/apache2/access.log | grep '" 400 ' | tail -5
grep -n "nav-menus.php" /var/log/apache2/modsec_audit.log | tail -5
The first command should list your failed saves with status 400. If the second finds entries, open the audit log at those line numbers and look for [id "..."]: that number is the rule that fired.
Do not switch the whole firewall off. Remove only that rule, and only for the menu screen, in the virtual host config (ModSecurity directives usually are not allowed in .htaccess):
<LocationMatch "/wp-admin/nav-menus\.php">
SecRuleRemoveById 123456
</LocationMatch>
💡 Replace 123456 with the ID from your audit log, then run apachectl configtest and reload Apache.
On shared hosting you cannot do this yourself. Open a ticket and give the host three things: the exact time of a failed save, the URL /wp-admin/nav-menus.php, and the error text. Ask them for the ModSecurity (or WAF) rule ID that matched and to exclude it for that URL. A precise request like this gets fixed much faster than “my menu doesn’t save”. I covered the same approach for a cache plugin in WP Rocket Preload 403 Errors: Allowlist the Preload Requests.
Also check your own security plugins and Cloudflare WAF events. A plugin firewall can block admin POST requests too, although it usually shows its own block page, not Apache’s plain one.
In OpenPanel’s Web Firewall (Coraza with the OWASP Core Rule Set) you can do this from the panel: recent blocked requests show the rule IDs, and you can click Disable rule for that domain or paste the ID into Disabled IDs. There is also a WordPress app profile meant to stop false positives on WordPress admin screens. In cPanel the ModSecurity page lets you turn ModSecurity on or off per domain, but excluding one rule ID usually means asking the host.
Step 4. Big menus: check request size limits
A menu save is bigger than most people think. Each menu item sends a set of fields (ID, title, URL, parent, position, classes and so on). On top of that, WordPress serializes the whole form into one JSON field called nav-menu-data on submit, and the original fields are still sent as well. So the POST body carries the menu data twice.
With a mega menu of a few hundred items, that body can cross a limit that ordinary page saves never touch: a WAF’s request body limit, Apache’s LimitRequestBody, or a reverse proxy in front of Apache. Depending on which layer rejects it, you get a 400, a 413 or a 403. The 413 version is the same problem I described in 413 Request Entity Too Large When Saving a Page in WordPress.
The quickest workaround that needs no server access is to split the menu. Move a large submenu into its own menu, or replace long lists of category links with one link to a page that lists them. Fewer items also make the menu screen itself much faster.
Step 5. Raise max_input_vars (only if items go missing)
Most tutorials jump straight to max_input_vars, but it causes a different symptom. PHP’s default is 1000, and when a request has more variables, PHP issues a warning and drops the rest. You get a normal “menu updated” screen, but the last items are gone or out of order. It does not produce Apache’s Bad Request page.
It also matters less than it used to. Since WordPress 4.5.3 core expands that nav-menu-data JSON field back into $_POST (the function is _wp_expand_nav_menu_post_data()), and the code comment says it exists “to avoid PHP max_input_vars limitations”. Plugins that add their own fields to menu items or break the admin JavaScript can still run into it, so it is worth checking.
Look under Tools > Site Health > Info > Server for “PHP max input variables”. Do not trust wp eval for this, because the CLI often reads a different php.ini than the web server.
To raise it, back up the file you edit first, then use whichever your host supports. With PHP-FPM or CGI, add this to .user.ini in the WordPress root:
max_input_vars = 3000
With mod_php, use .htaccess instead:
php_value max_input_vars 3000
💡 A php_value line on a PHP-FPM server causes a 500 Internal Server Error on the whole site. If that happens, remove the line right away and use .user.ini.
.user.ini changes can take a few minutes to apply because PHP caches them. Reload Site Health until the new value shows. In OpenPanel this is under PHP > Options, where max_input_vars is in the default list (see the PHP Options docs). In cPanel the equivalent is the MultiPHP INI Editor.
Keep it from coming back
Once you know the rule ID, keep it in a note with the date. Hosts update their WAF rule sets regularly, and the same block can return after a migration or a new rule set. Keeping menus under a few hundred items avoids most of the size problems altogether.
If the block editor shows a similar silent failure when saving posts, that is usually a blocked REST API request instead. I covered it in Updating Failed: Not a Valid JSON Response in WordPress.
TL;DR: “Your browser sent a request that this server could not understand” when saving a WordPress menu comes from the server, not WordPress. Test in a private window to rule out oversized cookies, save a one-item test menu, then get the WAF rule ID for /wp-admin/nav-menus.php from the logs or your host and exclude only that rule. For very large menus, split them. Raise max_input_vars only when items disappear after saving. Details on the limits are in the Apache core docs and the PHP manual.

