Fix WordPress Menu Crash

Ever had a WordPress site with a huge amount of items in the Menu? Well I have (not this one), and after adding a menu item one day, the whole menu crashed, and with crashing I mean, it was written out as plain text over the whole page instead of being a neat menu in the header.

So, after some searching online, if found a bunch of people all complaining about this, some even suggesting you should buy a “mega menu plugin” to solve the problem.

Well actually, the problem is not in the WordPress or in the theme. Well, one might argue that it’s the way WordPress saves the menu, while it’s being edited that’s actually the problem, but never the less the problem is actually that there are limitations in PHP for how many input variables you are allowed to post in one transaction, so just login to your webserver, and edit your php.ini.

In my case I edited /etc/php5/apache2/php.ini and added the following on the end of the file:

; WordPress Edit Menu Fix
max_input_vars = 5000