AUTHOR: // CATEGORY: Development, Wordpress

    No Comments

    So I had a request to add a super big menu in WordPress, and some sub menu’s and then after configuring the menu and clicking save half my menu disappeared. Apparently there is a limit that is set.

    This limit is not imposed by WordPress but by your web hosting server because of some security reasons. In PHP, there is a thing called post vars that controls menu items. By default maximum post vars are much limited as most of the websites require only a few menu items.

    It is very easy to increase number of post vars using php.ini

    All you need to do is adding a piece of code in your php.ini file. Keep in mind that different web hosts support different kind of methods and we have listed all here;

    Increasing max_input_vars

    To increase input_vars add the following code in your php.ini file

    max_input_vars = 3000;

    Note – Create a text file name php.ini and add this code to that file and place this file in your WordPress root. If your host doesn’t support custom php.ini file get their support to add this code ot php.ini file

    If your server is using Suhosin

    If your hosting server has Suhosin running, it will affect your WordPress menu limit and you need to add the following code in your php.ini file; = 5000

    suhosin.request.max_vars = 5000

    Other methods

    If above given workarounds don’t work, you can also try some other;

    1.Add php.ini in wp-admin folder

    Create a php.ini file with the below given code and put it into wp-admin folder

    max_input_vars = 3000;

    This is the one that worked for me!

    2.Add .user.ini file

    Create a file .user.ini and add the following code to it and try placing it in WordPress root or in wp-admin folder;

    max_input_vars = 5000;

    Hopefully one of the method should work for you.

    Credits to:

    Read more at:

    The WordPress Menu Item Limit or: Help! Half my menu items just disappeared!