Delete Menu
Permanently deletes a classic menu and all of its items. Classic menus have no trash and no revisions, so this cannot be undone; it needs confirm set to true, and without it the reply says exactly what would be lost, including the theme locations that would be left empty. The pages and posts the menu linked to are not touched. The result lists every removed item in order so the menu could be rebuilt.
Also known as: delete menu, remove menu, get rid of a menu.
| Property | Value |
|---|---|
| Ability slug | mosmcp/menu-delete |
| Wire tool name | mosmcp__menu-delete |
| Category | Menus & Navigation (mosmcp-menus) |
| Plan | Free |
Required access
| Requirement | Value |
|---|---|
| Capability | edit_theme_options |
| Minimum default role | Administrator (Shop manager too when WooCommerce is active) |
| Annotations | readOnly: false · destructive: true · idempotent: true · openWorld: false |
Input schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| menu | integer | string | Yes | — | The menu: its numeric ID, its slug, or its name (for example 7, "main-menu" or "Main Menu"). The name of a theme location that has a menu assigned also works, for example "primary". |
| confirm | boolean | false |
Must be true. The menu and every item in it are deleted for good. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| deleted | boolean | Yes | |
| menu_id | integer | Yes | |
| name | string | ||
| items_removed | integer | ||
| locations_emptied | string[] | Theme locations that now show no menu. | |
| removed_items | object[] | Every item that was in the menu, top to bottom, as it was before the delete. | |
| removed_items[].item_id | integer | The menu item's own ID, which every other menu ability takes. It is not the ID of the linked page. | |
| removed_items[].label | string | Text shown in the menu. | |
| removed_items[].uses_linked_title | boolean | True when the item has no label of its own and shows the linked page or category title, so renaming that page renames the item too. | |
| removed_items[].type | string | "post_type" (a page, post or other content), "taxonomy" (a category, tag or other term), "post_type_archive", or "custom" (a typed address). | |
| removed_items[].type_label | string | What wp-admin calls it, for example "Page", "Category" or "Custom Link". | |
| removed_items[].object | string | The linked content type or taxonomy, for example "page", "post" or "category"; "custom" for custom links. | |
| removed_items[].object_id | integer | ID of the linked page, post or term; 0 for custom links and archives. | |
| removed_items[].url | string | ||
| removed_items[].open_in_new_tab | boolean | ||
| removed_items[].css_classes | string[] | ||
| removed_items[].description | string | Item description; only some themes display it. | |
| removed_items[].title_attribute | string | Tooltip text shown when hovering the link. | |
| removed_items[].link_rel | string | Link relationship, for example "nofollow". | |
| removed_items[].parent_item_id | integer | Item this one is nested under; 0 for the top level. | |
| removed_items[].position | integer | 1-based position among the items that share the same parent. | |
| removed_items[].depth | integer | 0 for top-level items, 1 for their children, and so on. | |
| removed_items[].linked_status | string | For page and post links, the linked item's status (publish, draft, private, trash...) or "missing"; for term and archive links "ok" or "missing"; empty for custom links. | |
| removed_items[].shown_to_visitors | boolean | False when WordPress hides the item from visitors because what it links to is gone or trashed, or because the item itself was never saved. | |
| notes | string[] |
| << Previous | Next >> |
|---|---|
| Create Menu | Get Menu Items |
For more information about the Secure MCP Server for WordPress plugin, explore the following resources:
Product Overview | Pricing | Try for Free | Documentation
If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.