On a regular basis we get requests from users about a particular WordPress problem: it’s impossible to have a larger number of allowed menu items than what the user has at the given time. Although it's usually not a very good idea to create custom menus in WordPress with a very large number of menu items (keep usability in mind), some users experience a limit of menu items in WordPress when approaching a certain number, often near to 100 menu items.
But this limit of menu items in WordPress can also occur at any other number of menu items, because the limit is related to the server settings. That means even if you have much less items in your WordPress custom menu, it's possible that you can't add more menu items because of this limit. The following is a quick tutorial about how to fix WordPress menu item limits.
Different Servers – different Settings
Each individual server has its own individual settings, people from DigitalOcean will have custom servers with custom settings each time, and people from Linode will have the exact same thing, even those who use hosting companies like HostGator or BlueHost, will find that their server configuration is always different from the guy sitting next to them.
This means that it's possible to encounter problems with menu items and their limits. Some might have the limit at only 49 menu items, while others might be able to use 89 menu items before a limit is set in place. While many website owners and bloggers will never have the need for that many menu items, a reasonable portion of the WordPress community does need this feature, and we're here to help you solve the problem once and for all.
Because this is strictly a server problem, you will have to edit some sensitive files, but it won't take longer than a couple of minutes, so don't worry about having to know anything about server development at all, in most cases you don't need to know anything but how to use the copy/paste function of your computer. Although it's highly recommended to only modify server settings if you are familiar with these tasks, otherwise your hosting provider might be able to help you with this.
Suhosin is an advanced protection system for PHP installations. It was designed to protect servers and users from known and unknown flaws in PHP applications and the PHP core. The limitations come from the maximum amount of POST variables that are the main cause for a large quantity of item menus being saved. (In simple English.)
There are two ways to edit the Suhosin variables to enable larger number of items that can be saved using PHP scripts. There is no guarantee that the following solutions will always remove the WordPress menu item limit because in the end it depends on the specific server configuration, but in most cases one of these solutions should help to remove the menu item limit.
The first method you could try is to edit the .htaccess file which is stored in the home directory of your WordPress installation. All you have to do is add the following code snippet:
php_value max_input_vars 5000
and it should automatically remove any further menu item limits, or any other limits of that sort. You can also try to increase the value from 5000 to 7000 or more if the limitations persist, however – another reason they may persist is because the PHP server is not responding to your code entry, and in that case you could try to use the solution number two.
It's the same thing as with .htaccess, you need to locate your PHP.ini file on your server and add the following lines of code:
suhosin.post.max_vars = 5000 suhosin.request.max_vars = 5000
max_input_vars = 5000
and restart the server if necessary. You will find that the limits get lifted quite easily and you no longer need to stress about any menu item limitations. If the problem does continue to persist, you will need to reach out to the technical team of your web host and talk to them about this issue.
This article also helped users with the following questions:
- How to fix WordPress menu item limit
- Adding menu items in WordPress is not possible
- Menu items have suddenly disappeared
- Why can't I add more menu items in WordPress?
- WordPress menu is limited
- How to add many menu items in WordPress?
- Domino: ivanacoi / Pixabay.com