I want to add more item in my menu
I've a menu that contains at least 90 item in wordPress menus (administration), I want to add more and I found that others are removed automatically.
Any solution?
In most likelihood ( but not 100% ) , This is a PHP limit, not WP.
You can verify / configure it by looking at your php.ini.
Basically, the problem is max_input_vars
variable in php.ini
.
This variable was introduced in PHP version 5.3.9 and has the default value of 1000.
You should try to increase it to 1500
or even 2000
.
As you can see in the above php doc link, This is basically a limit applied to $_GET
, $_POST
and $_COOKIE
superglobal separately.
Every time you click the save menu
button in wordPress, you basically sending a lot of POST
variables estimated by this formula :
"Total POST variables" = 11 * "number of menu items" + 9
So you can easily understand that when you add 90
menu items you are actually sending
( 11*90 ) + 9 = 999
that is too close to your default limit of 1000
and any further POST
item will tip the limit ..
Similarly , When you add it via POST Ajax
( add menu by drag and drop ) the formula is a bit different - but the concept is the same ..
"Total POST variables" = 10 * "number of menu items" + 3
So just calculate your limit - and increase accordingly ( with ratio and a bit of safety margin.. just putting 10,0000
might work but it is not very logic .. )
Some further tech detail can be found here or here
A bit of googling will also find a plugin to help you with a notification when you arrive to that limit.