Inicio - Documentación - POM AI - 23 MCP - Prompt recipes - Recipe: update a WordPress menu without breaking hierarchy

Recipe: update a WordPress menu without breaking hierarchy

Menu item IDs, object IDs, and parent IDs are different values. Read the complete target menu before proposing a change.

List menus and resolve [MENU NAME OR ID] to one exact menu. Read its items and
show the current hierarchy. Prepare the smallest change: [CHANGE]. For each
affected item, show its menu-item ID, type, linked object or URL, parent
menu-item ID, position, label, and target. Dry-run the supported create or
update call and wait for confirmation. Apply it, then read the menu back and
render the final hierarchy. Do not delete any item unless deletion was
explicitly requested and confirmed.

When moving an item, ensure its new parent exists in the same menu and that the change does not create a cycle. When adding a custom link, validate the URL and visible label. When linking a post or taxonomy object, use its object ID and the correct item type.

Deleting a menu item is permanent in the MCP integration and can leave child items without their intended parent. Treat deletion as a separate task with a before snapshot.

Related guides: menu tools, create menu item, and failed-write recovery.