WordPress: “Request Entity Too Large” Error Prevents Saving Changes to Menu
Recently, I finished writing a new page for my blog, and was looking to add it to the main menu. So I proceeded as I normally would – in the WordPress dashboard, I selected “Appearance,” then “Menus.” In that editor, I added the new page, and pressed “Save Menu.” Then, to my surprise, I got this error, which prevented me from saving my changes:
Granted, after reading the error message completely, I realized that I was at least somewhat to blame. After all, the size and complexity of my menus were beyond anything I’d seen before in a WordPress site.
Then again, was it my fault? Shouldn’t software like this just work? With that in mind, I took to Google to find a solution to my problem. What followed was a quest that lead to me trying many different things: changing PHP variables, checking error logs, restarting services, my server, etc. Ultimately, none of these steps worked for me. However, thanks to the articles I had encountered, I managed to find a way around the error, without actually modifying my server in any way.
One of the articles I found lead me to the official entry in WordPress’ bug database, for the issue itself: #14134 Menus item are limited to 16 item and will not save more than that. Once I found this page, I started reading the conversation as it progressed across time, between developers. Eventually, I spotted this particular comment by “helgatheviking” (emphasis added):
“Trevor, if I understand it is only solved in the Customizer. If you edit and save your menu on the admin side you are still at risk of getting the menu cut off.”
Ah, yes, the customizer. I had totally forgotten that WordPress had another way of managing menus. And yet, it was right in front of me the whole time:
Sure enough, if I modified my menus using this “Live Preview” mode, the error no longer occurred. While not an actual solution, it successfully allowed me to save my menu, without any issues. I certainly learned from the situation, however, and decided that I’d reduce the complexity of my menus in the future. The world, after all, is more focused on search, these days – there’s no reason for me to build a directory. If someone’s looking for something, they’ll search for it, and that’s how they’ll find it. But until then, thanks to “helgatheviking,” and the great articles that lead me to solve my problem.