Manage and rebuild navigation menus

MenusIntermediate~15 min

Before you start

A connected site whose bound user holds the edit-theme-options capability, with the menu read and write abilities enabled. The menu writes are off by default.

Navigation is one of those things everyone means to tidy and nobody opens the menus screen to do, because dragging items around by hand is fiddly and easy to get wrong. This has the agent read your current menus, propose the structure you describe, and build it out in batches you approve, without touching a link until you have seen the plan.

The prompt
Help me sort out the navigation menus on this site, and build nothing until I
approve the plan.
Start by reading what's there: list the menus, and for the one called [Main
Menu] show me its items in order, each item's label and where it links. Lay it
out so I can see the current structure.
Here's what I want the menu to become: [describe the new set of links, for
example Home, Services, Pricing, Blog, Contact]. Draft that as a plan and wait
for my okay. Once I approve, either build it as a new menu or add and rename
items on the existing one, a few at a time, showing me each batch. Update an
item's label or URL rather than duplicating it where you can. If any items
should be removed, show me that list separately and wait for a second yes,
since removing a menu item is permanent. When you're done, list the menu and
every item you added, changed, or removed, and remind me to
assign the menu to its spot under Appearance if it's a new one.

Why this is safe to run

The reads come first: listing the menus and laying out the target menu’s items writes nothing, so you approve a plan before anything is built. The write abilities, creating a menu, renaming it, adding an item, editing an item, and removing an item, are each off until you enable them and each requires the edit-theme-options capability on the user you bound the agent to. Removing an item is the only destructive step, so it is held behind a separate approval and is permanent (menu items have no trash); the recipe never deletes a whole menu. The agent works in batches you watch, and every change lands in the Activity Log.

Already connected? Ask your agent for the “rebuild the navigation menus” recipe, describe the structure you want, and it runs the same read-then-approve flow on your own menus.

How it works

  1. List the menus and their item counts.
  2. Read the target menu's items in order, with each label and its link.
  3. Draft the new structure as a plan and wait for your approval.
  4. Build a new menu or extend the existing one, adding and renaming items in batches.
  5. Update an item's label or URL in place rather than duplicating it.
  6. Remove an outdated item only from a list you approve, since removals are permanent.
  7. List the menu and every item added, changed, or removed, and note any next step for you.

Questions

Can it remove menu items or delete a whole menu?
It can remove a menu item, but only from a list you approve first, and a removed item is permanent since menu items have no trash, so you would rebuild one by hand if needed. It never deletes a whole menu in this recipe. Adding and renaming stay the default, and nothing is dropped without your explicit yes.
Will the new menu show up on the site automatically?
Building a menu and assigning it to a theme location are different things. The agent builds and fills the menu; putting a brand-new menu into a header or footer slot is a one-click step you do under Appearance, and the recipe reminds you when that step applies.