WordPress.org

Ready to get started?Download WordPress

Forums

Menu Size Limit (33 posts)

  1. Rob@etiamco
    Member
    Posted 1 year ago #

    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?

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Can you replicate the problem using the Twenty Eleven theme with all plugins deactivated?

  3. Rob@etiamco
    Member
    Posted 1 year ago #

    Not easily, the framework for my site http://etiam.co/ was initially set up by external consultants and I have taken over the customisation and development, learning as I go. This is my first WordPress site.

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    Then I can only suggest that you go back to your external consultants for support.

  5. Rob@etiamco
    Member
    Posted 1 year ago #

    My consultants advise that their research suggests that this is not theme related, but is owing to a fundamental limitation in the way WordPress handles adding items to the menu.

    They advise that I can increase the memory limit as follows:

    http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP

    …but that's still not a guarantee that it will work.

  6. esmi
    Forum Moderator
    Posted 1 year ago #

    With all due respect, a single menu that contains 90 items does pose some really significant usability issues. Perhaps you need to re-think your navigation approach? I can thoroughly recommend the "Don't Make Me Think" book by Steve Krug. You might find it very useful in this situation.

  7. Rob@etiamco
    Member
    Posted 1 year ago #

    Agreed, it might be better if the theme allowed multiple menus, but we work with the limitations dealt us.

  8. esmi
    Forum Moderator
    Posted 1 year ago #

    There's no reason why the theme could not be amended to included multiple custom menu locations if necessary.

  9. Rob@etiamco
    Member
    Posted 1 year ago #

    Have we concluded that a limit of 90 items on the menu is a feature of WordPress and cannot be resolved?

    Introduction of Multipe Custom menu locations will certainly complicate the navigation to the 70 destinations for which we have special offers thatt can currently be navigated to from the top menu.

    The best solution for my site would be to resolve the issue of the 90 menu item limit.

  10. esmi
    Forum Moderator
    Posted 1 year ago #

    Have we concluded that a limit of 90 items on the menu is a feature of WordPress and cannot be resolved?

    No. WordPress does not impose any limit on menu items. This is a server issue.

  11. birgire
    Member
    Posted 1 year ago #

    you should try to increase the value of the max_input_vars variable in php.ini

    The default is 1000:

    max_input_vars 1000 PHP_INI_PERDIR Available since PHP 5.3.9.

    http://php.net/manual/en/info.configuration.php

    How many input variables may be accepted (limit is applied to $_GET, $_POST and $_COOKIE superglobal separately). Use of this directive mitigates the possibility of denial of service attacks which use hash collisions.

    Try for example 2000

  12. thebegbie
    Member
    Posted 1 year ago #

    We have also run into exactly 90 menu items (or nodes (i.e. sub menu, whatever) total allowed. If you add any more menu items (in sub menus or whatever), then the bottom one just drops off.

  13. thebegbie
    Member
    Posted 1 year ago #

    Whoohooo! I just fixed it. It appears that the limit of 90 is fixed by adding/editing the max_input_vars = 2000 in the ini file (it was commented out and has a default value of 1000). Hope this works for you too.

  14. Piyush Rathi
    Member
    Posted 1 year ago #

    I am facing the same issue ,Can't add more than 90 menu items in a menu and I have tried resolving it with increasing max_input_vars to 5000, memory_limit to 256M and also max_input_time to 80 and 100,but have the same issue

    Also,suhosin is not installed on the server so using suhosin.post.max_vars & suhosin.request.max_vars will be useless.

  15. bradgb
    Member
    Posted 1 year ago #

    I encountered the same limit of 90 items max. All the rest would just disappear on save. Increasing memory related settings had no effect. The solution was to increase max_input_vars as stated above.

    Usability aside: Since the default setting for php max_input_vars=1000, and the menu editor has > 10 fields per menu item, its pretty safe to assume that using a standard wordpress install people ARE going to encounter an upper limit of less then 100 menu items. While this isn't WP's fault, the menu editor should really handle this more smoothly. Perhaps it could warn people if they are nearing the limit, and/or some items were trucated.

  16. freshwater
    Member
    Posted 1 year ago #

    WP 3.5.1 - still reached menu limit, about 108. can't add another menu item. this is an add on domain, installed WP with Softaculous. do i have a syntax error? the inmotion hosting guys are pretty good, they've helped me edit these files, have no idea the problem. are there higher level files that need to be changed? does the server actually have to be restarted? thank you!

    max_execution_time = 90 ; Maximum execution
    max_input_time = 60 ; Maximum amount of time
    memory_limit = 512M ; Maximum amount of memory
    max_input_vars = 2000

    suhosin.post.max_vars = 5000
    suhosin.request.max_vars = 5000

  17. Nick Young
    Member
    Posted 1 year ago #

    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]

  18. birgire
    Member
    Posted 1 year ago #

    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

    max_input_vars=1109

    See more here:

    http://wordpress.stackexchange.com/questions/96587/menu-items-dissapearing/96593#96593

  19. Nick Young
    Member
    Posted 1 year ago #

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

  20. radiostar
    Member
    Posted 1 year ago #

    Which one plugin?

    Thanks!!!

  21. birgire
    Member
    Posted 1 year ago #

    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).

    ps:

    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
  22. radiostar
    Member
    Posted 1 year ago #

    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?

  23. Corrado
    Member
    Posted 1 year ago #

    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...

  24. birgire
    Member
    Posted 1 year ago #

    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.

  25. chris_burnham
    Member
    Posted 1 year ago #

    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.

  26. freshwater
    Member
    Posted 1 year ago #

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

    Weaver II by WP Weaver
    http://weavertheme.com/

    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.

  27. ffwebdesigner
    Member
    Posted 1 year ago #

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

    max_input_vars = 2000

  28. ajaykumarmeher
    Member
    Posted 1 year ago #

    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:

    suhosin.post.max_vars = 5000
    suhosin.request.max_vars = 5000

  29. Stephen Woodall
    Member
    Posted 1 year ago #

    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:

    http://core.trac.wordpress.org/ticket/14134#comment:63

    Hope this helps others who may have been stumped still.

  30. bustel
    Member
    Posted 12 months ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic