Menu Tools
Menu tools manage WordPress navigation menus and theme location assignments. Available on all plans.
| Tool | Description |
|---|---|
wp_list_menus | List all menus |
wp_setup_menu | Create + populate a menu in one call |
wp_delete_menu | Delete a menu |
wp_list_menu_locations | List available theme locations |
wp_assign_menu_location | Assign a menu to a theme location |
wp_list_menu_items | List items in a menu |
wp_add_menu_item | Add an item to a menu |
wp_update_menu_item | Update a menu item |
wp_delete_menu_item | Delete a menu item |
wp_reorder_menu_items | Reorder items |
Create a full menu in one call
Section titled “Create a full menu in one call”// wp_setup_menu{ "name": "Main Navigation", "location": "primary", "items": [ {"title": "Home", "url": "/", "order": 1}, {"title": "About", "url": "/about/", "order": 2}, {"title": "Pricing", "url": "/pricing/", "order": 3}, {"title": "Contact", "url": "/contact/", "order": 4} ]}Add items individually
Section titled “Add items individually”// wp_add_menu_item — by URL{"menu_id": 5, "title": "Blog", "url": "/blog/", "order": 5}
// wp_add_menu_item — link to a page by ID{"menu_id": 5, "object_type": "page", "object_id": 42, "order": 5}Nested items (dropdowns)
Section titled “Nested items (dropdowns)”Pass parent_id to nest under another item:
{"menu_id": 5, "title": "Team", "url": "/about/team/", "parent_id": 12, "order": 1}Assign to a theme location
Section titled “Assign to a theme location”// wp_assign_menu_location{"menu_id": 5, "location": "primary"}Check available locations with wp_list_menu_locations first — slugs are theme-specific.