Menus
The menu command group syncs Block-based Navigation menus created via the Full-Site Editing interface. Menus are saved as a JSON file that you can commit and deploy.
Commands
Section titled “Commands”lps menu pull
Section titled “lps menu pull”Download all navigation menus from WordPress.
lps menu pull| Flag | Description |
|---|---|
--config | Path to the output JSON file (default: menus.json) |
Example:
lps menu pulllps menu pull --config ./theme/menus.jsonThe output file contains an array of navigation post objects including their block content and IDs:
[ { "id": 42, "name": "Primary Navigation", "content": { "raw": "<!-- wp:navigation-link ... -->" } }]lps menu push
Section titled “lps menu push”Upload menus from a local JSON file back to WordPress. Each menu is matched by its id.
lps menu push| Flag | Description |
|---|---|
--config | Path to the source JSON file (default: menus.json) |
Example:
lps menu pushlps menu push --config ./theme/menus.jsonTypical workflow
Section titled “Typical workflow”# 1. Pull menus from staginglps site switch # select staginglps menu pull --config menus.json
# 2. Commit to Gitgit add menus.json && git commit -m "sync: menus from staging"
# 3. Push to productionlps site switch # select productionlps menu push --config menus.json- Menus are matched by
id. If the production site has different menu IDs than staging, the push will update the wrong menus. Always verify IDs match before pushing across environments. - Only block-based Navigation posts are supported (i.e. menus created via the Site Editor, not the classic Appearance → Menus screen).