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 - 1 through 15 (of 32 total)
  • esmi

    (@esmi)

    Forum Moderator

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

    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.

    esmi

    (@esmi)

    Forum Moderator

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

    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.

    esmi

    (@esmi)

    Forum Moderator

    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.

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

    esmi

    (@esmi)

    Forum Moderator

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

    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.

    esmi

    (@esmi)

    Forum Moderator

    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.

    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

    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.

    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.

    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.

    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.

    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

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