
Wp Wpcli And Ops
Run repeatable WordPress maintenance, migrations, and automation safely through WP-CLI with correct path, URL, and backup guardrails.
Overview
wp-wpcli-and-ops is an agent skill most often used in Operate (also Ship) that guides safe WP-CLI workflows for WordPress DB, plugin, cron, cache, multisite, and scripted automation.
Install
npx skills add https://github.com/wordpress/agent-skills --skill wp-wpcli-and-opsWhat is this skill?
- Guardrailed procedure: confirm environment, path/url targeting, and backups before destructive writes
- Covers wp search-replace, wp db export/import, plugin/theme lifecycle, cron, and cache flush
- Multisite-aware patterns with --url, --network, and wp site operations
- Repeatable automation via wp-cli.yml, shell scripts, and CI jobs
- Documents WordPress 6.9+ and PHP 7.2.24+ compatibility with WP-CLI required
Adoption & trust: 1.7k installs on skills.sh; 1.6k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need to migrate URLs, manage plugins, or script WordPress maintenance but one wrong wp command against the wrong path or production DB can destroy the site.
Who is it for?
Solo builders running WordPress in dev, staging, and prod who want agent-assisted WP-CLI for migrations, updates, and wp-cli.yml automation.
Skip if: Greenfield theme or block editor feature work with no WP-CLI involved, or hosts that forbid shell and WP-CLI entirely.
When should I use this skill?
Task involves WP-CLI for search-replace, db operations, plugin/theme/user/content management, cron, cache flush, multisite, or wp-cli.yml scripting.
What do I get? / Deliverables
You get a step-by-step, environment-checked WP-CLI procedure with correct targeting flags and backup discipline before writes complete.
- Documented WP-CLI command sequence with guardrails
- Repeatable script or wp-cli.yml configuration pattern
- Verified backup step before destructive database or URL operations
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Day-two WordPress operations—DB, plugins, cron, cache, multisite—map to Operate as the canonical home for production and staging upkeep. Infra subphase fits WP-CLI targeting, multisite network commands, wp-cli.yml scripting, and environment blast-radius control.
Where it fits
Execute a protocol or domain cutover using guarded wp search-replace during a approved maintenance window.
Flush caches, run cron, and update language packs across the correct site root without hitting the wrong install.
Wire wp-cli.yml into a deploy pipeline so staging plugin sets match production reproducibly.
How it compares
Use this ops playbook instead of ad-hoc wp commands in chat without environment or multisite targeting checks.
Common Questions / FAQ
Who is wp-wpcli-and-ops for?
Developers and operators maintaining WordPress sites who rely on WP-CLI for search-replace, database work, plugin lifecycle, cron, cache, multisite, and CI-friendly scripts.
When should I use wp-wpcli-and-ops?
Use it during Operate infra tasks and Ship launch prep when you run wp search-replace, db export/import, network-wide plugin updates, or wp-cli.yml jobs—after confirming path, URL, and maintenance constraints.
Is wp-wpcli-and-ops safe to install?
The skill encourages backups and environment confirmation, but any WP-CLI skill is high blast-radius; review Security Audits on this page and never run destructive commands on production without your own verified backup.
SKILL.md
READMESKILL.md - Wp Wpcli And Ops
# WP-CLI and Ops ## When to use Use this skill when the task involves WordPress operational work via WP-CLI, including: - `wp search-replace` (URL changes, domain migrations, protocol switch) - DB export/import, resets, and inspections (`wp db *`) - plugin/theme install/activate/update, language packs - cron event listing/running - cache/rewrite flushing - multisite operations (`wp site *`, `--url`, `--network`) - building repeatable scripts (`wp-cli.yml`, shell scripts, CI jobs) ## Inputs required - Where WP-CLI will run (local dev, staging, production) and whether it’s safe to run. - How to target the correct site root: - `--path=<wordpress-root>` and (multisite) `--url=<site-url>` - Whether this is multisite and whether commands should run network-wide. - Any constraints (no downtime, no DB writes, maintenance window). ## Procedure ### 0) Guardrails: confirm environment and blast radius WP-CLI commands can be destructive. Before running anything that writes: 1. Confirm environment (dev/staging/prod). 2. Confirm targeting (path/url) so you don’t hit the wrong site. 3. Make a backup when performing risky operations. Read: - `references/safety.md` ### 1) Inspect WP-CLI and site targeting (deterministic) Run the inspector: - `node skills/wp-wpcli-and-ops/scripts/wpcli_inspect.mjs --path=<path> [--url=<url>]` If WP-CLI isn’t available, fall back to installing it via the project’s documented tooling (Composer, container, or system package), or ask for the expected execution environment. ### 2) Choose the right workflow #### A) Safe URL/domain migration (`search-replace`) Follow a safe sequence: 1. `wp db export` (backup) 2. `wp search-replace --dry-run` (review impact) 3. Run the real replace with appropriate flags 4. Flush caches/rewrite if needed Read: - `references/search-replace.md` #### B) Plugin/theme operations Use `wp plugin *` / `wp theme *` and confirm you’re acting on the intended site (and network) first. Read: - `references/packages-and-updates.md` #### C) Cron and queues Inspect cron state and run individual events for debugging rather than “run everything blindly”. Read: - `references/cron-and-cache.md` #### D) Multisite operations Multisite changes can affect many sites. Always decide whether you’re operating: - on a single site (`--url=`), or - network-wide (`--network` / iterating sites) Read: - `references/multisite.md` ### 3) Automation patterns (scripts + wp-cli.yml) For repeatable ops, prefer: - `wp-cli.yml` for defaults (path/url, PHP memory limits) - shell scripts that log commands and stop on error - CI jobs that run read-only checks by default Read: - `references/automation.md` ## Verification - Re-run `wpcli_inspect` after changes that could affect targeting or config. - Confirm intended side effects: - correct URLs updated - plugins/themes in expected state - cron/caches flushed where needed - If there’s a health check endpoint or smoke test suite, run it after ops changes. ## Failure modes / debugging - “Error: This does not seem to be a WordPress installation.” - wrong `--path`, wrong container, or missing `wp-config.php` - Multisite commands affecting the wrong site - missing `--url` or wrong URL - Search-replace causes unexpected serialization issues - wrong flags or changing serialized data unsafely See: - `references/debugging.md` ## Escalation - If you cannot confirm environment safety, do not run write operations. - If the repo uses containerized tooling (Docker/wp-env) but you can’t access it, ask for the intended command runner or CI job. # Automation with WP-CLI Use this file when t