I try to remove a nav menu programmatically but I didn't find the way to do it. I knwo how to create it but I don't know how to delete it... I've got the menu name and I wan't to delete it like in wp admin panel but programmatically.

Or I want to delete all the menu item inside it.

  • Just delete it from admin. – Brad Dalton Jul 20 '14 at 16:29
  • programmatically – lolo Jul 20 '14 at 20:03
  • possible duplicate of Unregister Nav Menu with fallback? – Brad Dalton Jul 20 '14 at 20:33
  • I just try but it's not working in my case. In fact I want to completely delete the nav menu or item inside the nav menu then repopulate it... What wordpress do when you click on delete menu? – lolo Jul 20 '14 at 21:10

Finally the answer is simple:

$menu_name   = 'your menu';//name,id,slug
  • This answers the nav menu - But what about menu item? – Thomas Harris Mar 11 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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