How to Fix the WordPress Menu Items Limit

Last Updated on: May 27, 2015 @ 9:04 am

Last Updated on: May 27, 2015 @ 9:04 am

The WordPress menu items limit is a tricky problem which we’ve only seen twice before. The most recent was a few days ago, one of our clients with a rather large WordPress site started losing her menu items. It started suddenly and for no apparent reason. She started losing menu items after adding a new one. In fact the entire menu would disappear and she would have to recreate the entire menu and save it.

Then as soon as a new page or post was created and that item was added to the menu, the entire menu would disappear. She would then have to recreate the menu (once) again. With a small number of menu items this may take a minute or two to do but with large menus it’s a nightmare. Add to that nested menu items and you have a disaster.

What Is The Problem?

As mentioned earlier, it’s a tricky one as her menu length was about 40 items, the previous time we saw this the menu items was a bit more, it was over 60. There seems to be no fixed point at which this could occur. According to a WP Beginner article¬†referring to the same problem, they tried to recreate the problem going as high as 200 menu items without replicating the menu limit error. So it’s really all over the place.

So it seems it’s a combination of WordPress and PHP. There are Suhosin limitations on the POST max variables that are limiting larger numbers of entries from being saved. It’s a security precaution that can help prevent DoS attacks. You can read a more complete explanation here on SevenPark.

How To Fix The Problem

The quickest solution is to simply add a line to your php.ini file like so:

  1. Create a new file in the public_html directory of your hosting account and name it php.ini
    1. If you need help creating a php.ini file read this article in the Help Centre.
  2. Paste the following into that file: “max_input_vars=5000;”
  3. Click save to save the changes

And that’s it, you should have no further lost WordPress menus.

Try WordPress Hosting with Smart Features:

  • Daily backups with 1-click restore
  • WordPress updates
  • Plugin updates
  • Monitoring
  • SiteLock Malware & Hacker protection included!

Browse WordPress Hosting

Posted in
Home > Blog > How to Fix the WordPress Menu Items Limit

Get notified of new articles

New articles right to your inbox
No spam, we promise!

Join 2,844 other subscribers.

I'd like to hear your comments or questions?