Skip to main content
Glama

Remove a menu item

wp_delete_menu_item
Destructive

Remove 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

NameRequiredDescriptionDefault
item_idYesMenu item id, as wp_get_menu returns it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.7.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds substantial behavior beyond the annotations: sub-items keep the removed item as parent and may surface at top level, the call returns deleted and item_id, invalid ids are refused, and permissions can be withheld per item. It also emphasizes permanence and lack of undo, which is critical for a destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action is front-loaded, and each subsequent sentence adds distinct operational value: side effects on sub-items, return values, idempotent-ish refusal behavior, permissions, and permanence. There is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive tool with no output schema, the description is complete: it covers return values, permissions, permanence, side effects on child items, and behavior for invalid ids. An agent has enough information to call it correctly and understand the consequences.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the item_id meaning is already documented in the schema. The description reinforces that it targets one menu item, but does not add format or lookup details beyond what the schema already provides, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: remove one item from a navigation menu by item_id. It also immediately clarifies that the linked post/page is untouched, which distinguishes this from wp_delete_post and makes the scope unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear when-to-use and when-not-to-use context: use it only for menu items, not for the linked content, and note that this is permanent rather than a trashable delete. It also explains what happens to sub-items and to repeated calls on non-menu-item ids.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools