Get 30% off our WordPress plugins through Dec. 2nd!

How to increase the WordPress menu limit on your site

If you are trying to add another link or page to your WordPress menu and it simply doesn’t save then it’s most likely that you have hit a limit. However, this limit is actually due to a PHP variable limit on your server, not WordPress itself. Follow the instructions below to increase the menu limit on your WordPress site.

There are two different things you can try, changing the value in your .htaccess file or php.ini file.

Increase the WordPress menu limit via .htaccess

The first method you can try is changing the PHP value in your .htaccess file. Please note, if virtual hosts are set up the “allow overide” must be enabled for the .htaccess trick to work.

Step 1

First, open up your .htaccess file. It should be located in the root of your site.

htaccess file

Step 2

Your default .htaccess will most likely look like this below:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

We are going to add a single line towards the top.

php_value max_input_vars 2000

So afterwards your .htaccess file should look like this.

# BEGIN WordPress
php_value max_input_vars 2000
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Step 3

Now save your .htaccess file and re-upload it to your server. Then try adding more menu items on your WordPress site.

Increase the WordPress menu limit via php.ini

The second method you can try is changing the PHP value in your php.ini file.

Step 1

Edit your php.ini file and search for “max_input_vars.” It might look something like this:

; max_input_vars = 1000

The ; means it is commented out and the default value is set to 1000.

Step 2

You can uncomment it and change it to a higher value, such as:

max_input_vars = 2000

After this change you might have to restart Apache. Then try adding more menu items on your WordPress site.

Summary

Hopefully one of the above solutions will help fix your WordPress menu limit problem. If you have any problems with this, you can always reach out to your hosting provider to ask for help.

As always feel free to leave your comments below!

author bio
Brian Jackson

I craft actionable content and develop performance-driven WordPress plugins. Connect on X, subscribe to my newsletter (once a month), or buy me coffee.

7 thoughts on “How to increase the WordPress menu limit on your site”

    • Hi Chris… If you are having trouble with this I would recommend reverting back to your original .htaccess file and asking your web host to update it for you. It could be they are setting it server side.

      Reply
        • Hey Amir, the solutions above are correct and I have used them many times myself. If you are having problems changing your sites’ PHP value limits, I would recommend simply reaching out to your hosting provider. They can help you change the .htaccess or php.ini file values.

          Reply
    • I would check with your web host if you need help increasing this value. Could be your configuration is setup slightly different. Thanks

      Reply

Leave a Comment