I want to remove the link to the homepage from the main menu.

I can delete it with:

menu_link_delete(NULL, "<front>");

But I am worried about needing to undo that at some point in the future, or causing problems when some module expects that link to exist.

It looks like menu_link_save allows marking a menu item as "hidden", but I can't figure out how to get the mlid so that it knows I want to edit an existing menu item.

I have tried calling menu_main_menu, but the result doesn't appear to have a main_menu['<front>'] element.

Any suggestions?

1 Answer 1


Using the Features module let me export the menu, at which point it was easy to set 'hidden' => '1' on the 'main-menu:' link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.