How to add more menu items in WordPress if max_input_vars doesn’t work

Hi guys! In this tuttorial I will explain how you can add more menu items in Wordpress if added max_input_vars, suhosin.post.max_vars and
suhosin.request.max_vars doesn't work.

I have encountered this problem and I have solved it in this way:

In my functions.php file I have writed this code:

function my_custom_admin_head() {
?>
<script language="javascript">
jQuery(document).ready(function()
{
if(jQuery(".field-link-target").length > 0)
{
jQuery(".edit-menu-item-classes").each(function() {
jQuery(this).remove();
});
jQuery(".edit-menu-item-xfn").each(function() {
jQuery(this).remove();
});
jQuery(".edit-menu-item-description").each(function() {
jQuery(this).remove();
});
jQuery(".field-link-target").each(function() {
jQuery(this).remove();
});
}
});
</script>
<?php
}
add_action( 'admin_head', 'my_custom_admin_head' );

This code will remove some inputs, like CSS class, target blank, etc from menu items.

In this way you will be able to add more items!









Leave a Comment