Add Menu Item
wp_add_menu_itemAdd an item to a WordPress navigation menu. Supports links to posts, pages, categories, custom URLs, and more.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | URL for custom links (required when type="custom") | |
| type | Yes | Item type: "post_type" for posts/pages, "taxonomy" for categories/tags, "custom" for URL | |
| title | Yes | Menu item display title | |
| object | No | Object type: "post", "page", "category", "post_tag" (required for post_type/taxonomy types) | |
| parent | No | Parent menu item ID for dropdown/sub-menu (0 = top level) | |
| target | No | Link target ("_blank" opens in new tab) | |
| menu_id | Yes | Menu ID to add the item to | |
| site_id | No | Site ID to target (optional if you have only one connected site) | |
| object_id | No | ID of the post/page/term to link to (required for post_type/taxonomy types) | |
| menu_order | No | Position in menu (0-based) |