Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Fix the Custom Menu Items Limit in WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Fix the Custom Menu Items Limit in WordPress

Just a few days ago, one of our users reported an unusual problem. The problem was that he was reaching the custom menu items limit. Anything he saves after he reached the menu item limit would not save at all. We had never heard of this problem, so we decided to give it a try on our local install. Created 200+ menu items and saved it. It worked just fine. Moved 100 items into a dropdown and that saved perfectly fine. At that point, we knew that this had something to do with the server. Upon further research, it seemed that many others were having the same issue. Digging a little deeper, we found a trac ticket (#14134) that highlighted this problem. After reading the very very long trac ticket, it seems that the problem has not been fixed yet, but there is a work around fix for those who are having this issue. In this article, we will show you how to fix the custom menu items limit in WordPress.

To fix the issue, you need to edit your PHP.ini file. If you are on a dedicated server or on a VPS with root access, then you should already know what we are talking about. If you are on a shared hosting or don’t know where PHP.ini file is, then ask your web hosting provider to do this for you.

You need to ask them to set the following values in the PHP.ini configuration: = 5000
suhosin.request.max_vars = 5000

Another user “ronnieg” posted a work around that he has for his large (450+ pages and growing) real estate site and menu. You can read his response to follow along. (Note: we haven’t tried this one)

Explanation of the Problem

This problem is not entirely WordPress based as different folks are seeing different limits (some say 16 others say 50 and as you already know we went as high as 200 without seeing any limits). In theory, WordPress is not limiting the number of menus you can have. Your web hosting server is. There are Suhosin limitations on the POST max variables which is limiting the large number of entries being saved. Nacin replied in the trac ticket to say that this is NOT a bug rather it is an enhancement. The core team has to find a way to work around the server limitations and figure out a better way to save the menu items, so regardless of your server configuration you do not see any custom menu limits. It’s easier said than done :)

WordPress is an open-source (voluntary) project, and the core team does everything they can to improve it every day. This will be fixed, but the timeline isn’t defined yet as it says “Future Releases”.

If you have tried something different that fixed this issue for you, then please let us know in the comments. This will allow others to fix their issue until the core team finds a work around.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. Anton says:

    Hi, thank you for this

    I run and had this problem. I had long menu and some day it decreased to 50 lines only. Theme support sent to this topic. I’d tried all options, but only one works for me even with out contacting with hosting support.

    I’ve added “php_value max_input_vars 5000” (without quotes) to my .htaccess file before “#end of wordpress” line and it solved the problem.

  2. Ajay Damraliya says:

    Thanks bro :) i was facing the same problem now its fixed.

  3. Ramachandran says:

    Hi Team,

    I am using Hostgator with Multidomain SSL.

    I checked the settings and don’t know where and how to do.

    I added php.ini file with the code max_input_vars=9000; and still I am not able to add menu items on the main menu.

    Anyone help me. Much appreciated.

    Best regards,

  4. Dann says:

    I’m having this issue right now, I contacted the hosts whom say they can’t / won’t increase to 5000 vars because it is a shared server, is there any other solution? is it possible to have two navigation menu’s on the same page, would this solve the problem, or would it simply continue.

    Thanks in advance, any help would be much appreciated

  5. sdkmendis says:

    Awesome. I have same issue prolong times without clue. Ask so many peoples . Just today I fixed my problem. hostGator no need to call centre representative. We can do it our own. Realy help full No words to thanx

  6. Rajit says:

    What is the max limit we can set for this? I seem to have exhausted the 5000 limit as well.

  7. Renee says:

    Mahalo nui loa (thank you very much)!

    This worked for a client’s site that is at Bluehost, shared hosting:
    1. Cpanel > File Manager
    2. public_html > wp-admin
    3. Click “New File” > name it php.ini (if you don’t have this file already)
    4. Click php.ini > click “edit” > click “edit” again
    5. Paste: max_input_vars=5000; > Save > DONE

    • vipin says:

      Not working

    • Anjan Phukan says:

      Hi Renee, you saved me. Thank you so much.

    • Tan says:

      That work in my case! You are my angel! Fantatis share. I have had this problem for 2 day. Thank you so much!

    • Kelli says:

      Renee – this worked for my client also. Thank you! They are hosted with hostgator.

      • Hasan says:

        I tried,

        in .htaccess file:
        php_value max_input_vars 5000

        in php.ini file:
        upload_max_filesize = 70M;
        post_max_size = 128M;
        upload_tmp_dir = 70M;
        max_input_vars = 3000;
        memory_limit = 256M;

        in .user.ini file:

        and also test by placing php.ini & .user.ini in wp-admin and out of wp-admin, nothing works for me,

        by adding in .htaccess wp admin page shows blank (white).
        my hosting is

        any help appriciated. TIA

  8. Lou Comunale says:

    I use GoDaddy and the php.ini fix did not work at all for me. Godaddy doesn’t even recognize that page or code as valid.

    Getting help from the Godaddy people they provided me a workaround.

    I created a page in my html folder .user.ini (dot-user-dot-ini). On that page I added the code:

    max_input_vars = 3000

    Seems to work so far.

    • Akut Wibowo says:

      created a page in my html folder .user.ini (dot-user-dot-ini) -> did you mean create a FILE in your PUBLIC_HTML folder?

      Please confirm as I have same problem here in godaddy server also.
      And I can’t contacted them for a weeks.

      I dont know why it is so hard to contact godaddy.

      • Gabriel says:

        Akut I also use Godaddy.

        I found my php.ini file in file manager – public_html folder NOT in the php.admin nor did I have to create the php.ini file.

        Godaddy seems to think it is a WP issue, and I got the run around on that particular issue.

        They directed me to increase my file size limit. (Not the same fix) .

    • Ken says:

      This solution was the only one that worked on 1and1 hosting platform:

      I created a page in my html folder .user.ini (dot-user-dot-ini). On that page I added the code:

      max_input_vars = 3000

    • Thank you says:

      Thank you, this worked for me.

    • Anjan Phukan says:

      Lou, it worked for me. Thank you so much.

  9. Jay Patal says:

    I have face a Problem to add a sub menu in wordpress site it will convert to coustom link .
    pls help me resolve this error

  10. chandani says:

    Thanks…. work perfectly.

  11. mahesh says:

    just remove wordpress ; and go for magento best solution its worked for me after try 2 months i got the best solution

  12. WajhuAllah Arif Hussain says:

    On Ubuntu VPS i was able to fix it by uncommenting and setting higher values as below.

    max_input_nesting_levels = 500
    max_input_vars = 5000

    But anyways thanks as it provided a way towards the solution

    • Sumon says:

      Thanks, that worked for me too.

    • tanveer says:

      i love u man!
      your this solution also solved another problem of mine! the problem was

      “After saving the menu on the “Edit Menu” tab the “Menu Settings -> Theme Location” would not retain the check and on the “Manage Locations” tab the menu location would be dropped.”

  13. Alejandro says:

    Thanks a lot, it wordked for my very long menu!! :D

  14. Mino Taur says:

    HostGator Friends – Same Issue & This Solved it:

    1. Cpanel > File Manager

    2. public_html > wp-admin

    3. Click “New File” > name it php.ini (if you don’t have this file already)

    4. Click php.ini > click “edit” > click “edit” again

    5. Paste: max_input_vars=5000; > Save > DONE

    • Yannis says:

      Really great fix. Thanks!

    • Rajit says:


      My site is hosted on godaddy. I created php.ini in wp-admin and pasted the one line max_input_vars=5000;

      Still couldn’t add more menus.

    • Sangam KR says:

      Thanks for the suggestions. I followed your suggestion and added the php.ini file with max_input_vars=5000; and it solved my problem. Thanks once again

    • Lori says:

      1 – Make a text file
      2 – Put this in there ” max_input_vars=5000; ” (without the quotes
      3 – Save as php.ini
      4 – FTP into the public_html > wp-admin

      Thank you!!!

    • Anita says:

      Thank You, You saved my site! :-) This worked for me perfectly!

    • Hello Mino says:

      Same problem on my website

      My site hosted on HostGator. I added file php.ini in /wp-admin but this is not working for me. Please help me.

  15. Kimberly Potts says:

    I’m having this issue as well. I was directed to this site by a tech at Studio Press. I have a shared hosting account with Host Gator. They have upped my max_input_vars to 7000, because I wasn’t getting anywhere with 3000 or 5000. I did create a php.ini with your recommendations in my wp-admin. Still no luck. Do I need to delete the php.ini in my public folder, since I created one in the wp-admin? I’m trying so hard to resolve this. Many thanks.

  16. bedir says:

    ALEX you are hero man. I have read many things for solution. THANKS

  17. Muhammad Khizer Khan says:

    Thank you so much Alex, Really thankful to you.

  18. vijay lathiya says:

    Thanks for tips

    after increasing max_input_vars in php.ini its working.

  19. gezginrocker says:

    Because I’m on shared hosting, putting the php.ini on root folder didn’t work for me. But putting it in wp-admin folder worked. I think this is because nav-menus.php file is in wp-admin folder.

  20. Gadget says:

    Hi People, … yes I too came up against this menu issue/problem … and may I say YIKES!!! At somewhere between the 50 and 100 page mark, the last item I put on the menu was being kicked off, and/or falling off the main menu navigation! What?!!!

    Noobs, and other geeks alike, know this about that (problem) … and I am only speaking for my own case, though I do so in the hope that someone who experiences the same nightmare may benefit … so here we go.

    With ‘shared hosting’ using HostGator … there will be no ‘suhosin’ which is apparently a patch/program etcetera for scripting errors with php designed to protect ‘servers’ according to a HostGator Rep, … now, notwithstanding this detail, we continue … what was important in my case, … that I finally got my HostGator person, person #3 to understand, through all my babble about the problem, was, the part about the ‘max_input_vars = 3000’.

    My HostGator Rep put me on hold, investigated the issue, and determined that the ‘max_input_vars = 3000’ had to be put in the php.ini file, … that only HostGator has access to, … not the php.ini file that is in my/our ‘home’ or ‘root’ directory, that I/we all have access to, via our accounts with HostGator or other hosting providers, by using the CPanel as we often call this access point.

    This php.ini file is, in no way accessible via the internet by me, or us, as account holders with hosting account access, capiche? Good, and good to know.

    Now, what I did, was take what Alex, right below this post said to do, and I put these lines of text/code into a php.ini file that I then put in my public_html file area, inside of my ‘wp-admin’ folder, for the domain I was working with. For a time, I thought that this ‘fix’ was working, then today, I was adding more pages and ‘oh joy’ the main menu navigation items were falling off the line, crikey!!

    Back into the problem I went, re- reviewed this whole post and the ‘Coretrac Ticket’ thread, which is a tad over my head, but still, I was diligent and determined. And then back into the breach with the HostGator people for pow-wow #2, completed that call and had to go back in, with person #3 who was the charm.

    Lastly, what I learned is that, what the ‘max_input_vars = 3000’ is referring to is how many pages your installation/domain/WordPress can have, the ‘3000’ means pages. My HostGator Rep plugged in 5000 pages.

    So, I added two new test pages on the spot with him still on the phone and we report ‘joy’! Yay! I too should now be able to add pages to my heart’s content! May you also experience WordPress JOY!


    • Netman says:

      Issue was solved with php.ini file in wp-admin folder with following line on HostGator shared hosting account.

      max_input_vars = 9000;


  21. Alex says:

    Create a php.ini file but not in root! ( public_html )
    in “wp-admin” folder then add:

    max_input_vars = 3000;

    I also have :
    upload_max_filesize = 70M;
    post_max_size = 128M;
    upload_tmp_dir = 70M;
    max_input_vars = 3000;
    memory_limit = 256M;

  22. Jeffrey de Jongh says:

    Hi Thanks for this great tip! I had the same issue with UberMenu. Now I’ve added php_value max_input_vars 5000 to my .htaccess file and it solved the problem.

  23. Alanna says:

    I’ve tried a few things without any luck. I had my host make these PHP config changes. I also activated the Memory Bump plugin and then removed it as suggested by some others.

    My theme (Twenty Ten) supports only one menu. I am able to create another menu and make changes there without a problem. I have a live site so I’m a little limited in terms of the amount of experimenting I can do.

    Any other ideas? I’ll try anything at this point.

  24. Bhavin says:

    Thank you so much Mat.This worked Perfect…

  25. Matt says:

    Matt’s suggestion worked for me too, as I do not run suhosin.

    max_input_vars = 5000
    to my php.ini file

    • valente says:

      Hello, I placed a Php.ini file in wp-admin with max_input_vars = 5000
      but it did not work, does this php file need to be in another directory as well?
      thank you

  26. Bart says:

    I have the same problem, and the Memory Bump Plugin didn’t solve it.

    I contacted my hosting provider, and they said I don’t yet have a php.ini file and that I have to create it, or WP has to create it for me……

    How do I do this?

    • WPBeginner Support says:

      Bart if your webserver is running php scripts, then it certainly has a php.ini file which your web host can configure if they want to.

  27. Zek says:

    Seems that a simple fix would be for the WP ajax functionality to evaluate the number of items in the list and break it into multiple sequential requests instead of one big request.

    It’s weird to me that the wordpress team didn’t think of this ahead of time but I guess the platform is so robust that they simply have too much on their plate. I may end up doing it myself, but of course I’ll have to do it in a way that won’t get overwritten by future updates. What a pain!

  28. Larry says:

    I am in same situation as Mat Lipe. I was having problems because my server does not have suhosin installed. I was able to fix the problem by adding the directive that Mat posted to my php.ini file. Thanks.

  29. Selma says:

    I just hit the same problem and after days of emailing back and forth with the we hosting support, it’s finally been resolved!

    They did the following changes:

    They added max_input_vars = 5000 in php.ini

    That’s it, and now it works like a charm and I’m adding pages to my hearts content.

  30. Mat Lipe says:


    My server is not running suhosin so I was able to fix this issue by adding this to my php.ini file and restarting my server.

    max_input_vars = 5000

    Hope this helps anyone else out there with the same issue

  31. Dale says:

    Thanks for this.

    I experienced this quite a while back and thought it had something to do with the memory allocation.

    I eventually was able to add more menus after activating the Memory Bump Plugin ( ) from WordPressdotorg

    I deactivated the plugin afterwards.

    Was quick and easy without messing with any code.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.