Cant’ delete menu items in Drupal

Aug 1st, 2012 | By | Category: Internet

So today I was installing drupal on a new domain based on a skeleton install I setup so that I could replicate our CMS across different domains for different divisions in my company.  Anyways when doing so I noticed that I wasn’t able to delete some of the menu items created by previous taxonomy.

I could reset and I could disable but I couldn’t remove them even though I deleted the taxonomy items that created them as well as the views.

What I had to eventually do was to log into mysql, use the database for the CMS and do the following:

DELETE FROM `menu_links` WHERE `menu_links`.`module` = 'admin_menu'
DELETE FROM `menu_links` WHERE `menu_links`.`module` = 'system'

 

I then went to admin/build/modules and finally cleared all my caches and viola, they are gone.. Unfortunately it will reset the positions of all your menus so you’ll have to do some dragging and dropping again but at least the junk is gone

Tags: , , , ,

2 Comments to “Cant’ delete menu items in Drupal”

  1. ERIC JONES says:

    This worked perfect for the couple menus that I needed gone. Thank you!

  2. Motame says:

    I would not delete all of that.
    Only orphaned menu items can be specified in the query.
    Query first the table menu_links to get the menu link id (mlid), then delete it.
    1-
    SELECT FROM `menu_links` WHERE linke_name like ‘%SUBSTRING%’;
    Where SUBSTRING is the menu item name or a part of it.
    Then :
    2-
    DELETE FROM `menu_links` WHERE mlid = XXXX;

Leave a Comment