Rebuild Drupal menus using Drush

Sometimes, one menu item gets stuck and cleaning menu cache doesn't seem to work.

In those cases, there is a way to completely wipe out all the information that Drupal has about the menus and recreate it.

Using Drush we have to execute the following commands:

drush sqlq 'delete from menu_links'
drush sqlq 'delete from menu_router'
drush eval 'menu_rebuild();'

Be warned that these commands delete all the customs menus and menu items you have created. If you custom elements, it's not necessary to go that far and you could delete only some rows of the menu_links and menu_router tables.

 

 

Add new comment

(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.