Menu items disappearing from WordPress menus?


Menu items disappearing from WordPress issue

WordPress is a fantastic piece of software to use for you website, there’s no doubt about that. As with any software out there, bugs happen. Sometimes WordPress can have issues with menu items disappearing from the menu section after saving. This can happen with regular style menus and the newer and more customizable MegaMenus. After clicking the “Save Menu” button, if large portions of the menu are missing then you are probably running into this error! This error has to do with PHP settings (controlled in the php.ini file on your webserver). As of PHP 5.3.9 there is a new directive in the file called max_input_vars and by default is set to 1000. WordPress can easily reach this limit in the menu system.

Menu items disappearing from WordPress solution

There are two ways to fix this issue.

The php.ini fix

The first if you have access to your php.ini file (or can gain access) is to find (or add if it isn’t already there) the following line: max_input_vars = 1000; and change it to max_input_vars = 3000; This is the preferred fix if you can access your php.ini file. Some web hosting companies don’t let you have that type of granular control over your server however so you may need to try the next fix.

The .htaccess fix

If you don’t have access, or don’t know how to access the php.ini you can try adding this line to you .htaccess file on your webserver: php_value max_input_vars 3000. This is not the optimal method, and will most likely not work on the majority of web servers out there (but hey it’s worth a shot)!

The Ultimate Managed Hosting Platform
The Ultimate Managed Hosting Platform

Neither of these worked?

If you can’t access your php.ini / .htaccess files on your webserver or don’t feel comfortable doing it you can try contacting your hosting company to have them apply the fix. Just tell them you need the max input vars in your php.ini increased to three thousand to fix the menu items disappearing from WordPress bug.

Can’t figure it out? Feel free to give us a call or drop us a line and we can help you resolve your issue with menu items disappearing in WordPress menus!