Remove a menu item
wp_delete_menu_itemRemove a single navigation menu item by item_id without deleting its linked post or page. The deletion is permanent and cannot be undone, so confirm the item_id first.
Instructions
Remove one item from a navigation menu by its item_id; the linked post or page itself is not touched. Sub-items of the removed item are not removed: they keep it as their parent, and WordPress usually shows them at the menu's top level. Returns deleted and item_id. An id that is not a menu item is refused, so a repeated call changes nothing. Needs edit_theme_options and the right to delete this item (delete_post), which a site can withhold for single items. Permanent: the item is deleted, not trashed, and no undo point is recorded.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item_id | Yes | Menu item id, as wp_get_menu returns it. |