Support » Fixing WordPress » Menu Size Limit

  • I am using the Magnum theme and have hit a limit on the number of menu items I can add.

    I can get up to 90 items on my menu, and then it stops – I can add more, but when I click save menu, it reverts to the top 90 items.

    I have seen a similar issue on the forums recommending changing the PHP memory allocation and script timeout settings on the server.

    My ISP however advises that the limit on the server is set to 256MB and they don’t use suhosin so don’t think that is the issue. They advise I can try increasing the PHP memory limit further using ini_set() but think this might be a WordPress issue rather than a hosting issue. They suggest editing the PHP code as follows: ini_set(‘memory_limit’,’384M’);

    Unfortunately I do not know where to set ini_set() having searched some of the code in the theme editor. Any ideas?

Viewing 15 replies - 16 through 30 (of 32 total)
  • I am having this same problem as well. Stuck at 90 items. I will be calling the hosting company tomorrow to see if I can get it resolved and will let you know my findings.

    [irrelevant comment moderated]

    I think we can estimate it with

    max_input_vars >= 11 * "number of menu items" + 9

    for the Save Menu action.

    So with 100 menu items we need at least


    See more here:

    I could not get anything to work with this so I downloaded a plugin to do the trick.

    Which one plugin?


    For the default value max_input_vars=1000 the maximum number of menu items is 90, which is the number that many are reporting (like the 5 users above).


    Using the above formula we have

    1000 = 11 * x + 9

    where x = "number of menu items".

    Then by solving for x:

    x = (1000 - 9) / 11
    x = 991 / 11
    x = 90.0909090909...

    Finally, by lowering that to the nearest integer (floor) we get:

    x = 90

    Thanks birgire,

    I know that, I have changed max_input_vars to 3000, but my menu limit is still 90 … That’s why I was interested in plugin …

    By the way, my memory_limit is 128M at the moment, do I need to change it too?



    Hi there

    I have the same issue with a template I just bought for wp + woocommerce… a nice template indeed BUT have problem after 80 items in the menu… deleting the old one.

    So is not an installation issue BUT a theme issue…

    Just a suggestion…. but sure not a solution…

    1) Create the custom menu using a default theme of wp like twentyten
    and save

    2) Change the theme using your favorite one and the menu saved will be there…. be careful not save again the menu or will be gone

    3) Regretfully need to remember to switch theme before modify and save the menu…

    One should

    – verify the max_input_vars settings with

    <?php phpinfo();?>

    or via command line

    # php -i | grep max_input_var

    – Also check the server error logs.

    – If one is using suhosin then there are other parameters to consider.

    Just to clarify, the reason people are running into this issue is that max_input var. PHP by default doesn’t allow forms to submit more than 1000 post variables. This is done to prevent a obscure but devastating Denial of Service attack.

    The limit appears to be ~90 menu items because each menu item has about 11 hidden form fields attached to it. The edit menu page can’t save large menus because of this. Certain plugins might add even more options which will increase the size of the form.

    Another solution would be to look for a plugin with a drastically different menu editor. Maybe one that doesn’t let me drag and drop menu items, because that would greatly reduce the number of form variables. I’m going to hunt for one, because the site I’m looking at running has deeply nested pages, and we’re hoping to support more than 90 menu pages. I’ll followup here if I find a plugin that does this job.

    chris, the only theme i could find for a temporary solution is

    Weaver II by WP Weaver

    it allows a secondary menu. one menu system above the header image
    and one below the header image. this is the way/where the Main and Secondary menu land. i’m not smart enough to figure a way to position the 2ndary menu.

    this is the only thing that helped in my php.ini:

    max_input_vars = 2000

    I am having the same issue. I have around 200 menu+ sub menu items and I hv set max_input_vars to 150000 but still I hv the issue. NO suhosin installed on server.

    So looking at the numbe rof people having this issue with menu, it seems the issue is related to something else then the followimng fix suggested in WP TRAC: = 5000
    suhosin.request.max_vars = 5000

    Stephen Woodall


    I tried all of the suggested fixes for this issue and spent quite a bit of time working with my host without ANY success. However, I finally stumbled across a suggestion from another real estate website like my own that’s worked extremely well. He makes several suggestions that are good but the first one immediately fixed the problem and it was by downloading a plugin called:

    “Add Descendants As Submenu Items” by Alex Mills.

    After installing this plugin simply keep the top level menu item in your custom menu, open it’s options from the drop down and click the box to “Automatically add all descendants as submenu items”. NOTE: You must have your sub-pages set up in the order you want them to display as it’s using that hierarchy.

    Here’s the link to his many suggestions:

    Hope this helps others who may have been stumped still.



    I have a solution for this problem… you set the follow line in “.htaccess” on the server where your site is on:

    php_value max_input_vars 5000

    it works for me!

    I have ran into this problem on several occasions. Try this quick solution:

    Step 1: Open your favorite text editor (Notepad, Dreamweaver, etc.)
    Step 2: Create a file named “php.ini”
    Step 3: Paste the following code: php_value max_input_vars 7000
    Step 4: Save the file
    Step 5: Upload the file to your site’s root folder via ftp (Filezilla, Rush FTP, etc.)

    🙂 That’s it!

Viewing 15 replies - 16 through 30 (of 32 total)
  • The topic ‘Menu Size Limit’ is closed to new replies.