Guides/Use WP-CLI in Deployment Scripts

Use WP-CLI in Deployment Scripts

Run status checks, exports, dry runs, imports, and workflow jobs from CI or release scripts.
Updated 5 June 2026·Task guide

Outcome

WPChangeSync becomes part of a repeatable deployment pipeline instead of a manual admin-only step.

Video walkthrough

Video walkthrough coming soon.

The YouTube embed will appear here.
Risk level

Medium. Automation can turn small mistakes into repeatable mistakes. Use dry-run gates.

Before you start

  • WP-CLI can run in the target environment.
  • Storage paths are configured per environment.
  • Scripts use dry runs before writes.
  • Secrets are injected by CI, not committed.

Steps

  1. Check status
    Fail early if WPChangeSync is inactive or misconfigured.
  2. List integrations
    Confirm the target supports the integration IDs your script expects.
  3. Export or import settings
    Move non-secret settings as JSON where needed.
  4. Run workflow dry run
    Make dry runs part of pull request or predeploy checks.
  5. Execute after approval
    Run the actual workflow only after review or an approval gate.
set -enwp wpchangesync statusnwp wpchangesync integrations list --format=tablenwp wpchangesync workflow run  --mode=dry_runnwp wpchangesync workflow run  --mode=execute
Use real command names from your installed build
The command surface is broad and evolving. Run `wp wpchangesync --help` on the target environment before codifying CI scripts.

Verify and recover

After completing this guide, verify the result in Activity and on the target site. Keep the pre-change export or backup until the release has been accepted. If anything looks wrong, stop further syncs, restore the affected item or integration from backup, and re-run with a narrower scope or safer conflict strategy.

How to find the workflow ID

Open Workflows in the admin UI and inspect the workflow details, or run wp wpchangesync workflow list. Use the ID from that list in workflow show and workflow run commands.