Update a menu item
update_menu_itemAdjust WordPress menu items by changing labels, URLs, targets, nesting, positions, or moving them between menus.
Instructions
Change a menu item's label, target, nesting or position.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The menu item ID. | |
| url | No | New target URL. | |
| menus | No | Move the item to a different menu. | |
| title | No | New link label. | |
| parent | No | Set to 0 to move it back to the top level. | |
| target | No | _blank opens in a new tab. | |
| classes | No | Replaces the item's CSS classes. | |
| site_id | No | Which configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids. | |
| menu_order | No | New position; lower numbers come first. | |
| description | No | Item description, shown by themes that support it. |