Skip to content

Cookbook › WP-CLI

Add a page to your menu with WP-CLI

WP-CLI1 minuteChangesTested 15 Oct 2026
Paste into ChatGPT or ClaudeUse WP-CLI to add my “Contact” page to the main menu, as the last item.

Changes your site. Standard asks you first in wp-admin; Trusted does it directly.

  1. Your assistant runs wp menu list and wp menu item list to find the menu and its items.
  2. It runs wp menu item add-post with the page’s ID.
  3. It lists the menu again to show the result.
  • “Rename the ‘Shop’ menu item to ‘Store’.”
  • “Put the Footer menu in the footer location.”
  • Classic menus only. Block themes keep navigation in the site editor.