- Home
- Skills
- Automattic
- Agent Skills
- Wp Wpcli And Ops
wp-wpcli-and-ops_skill
- JavaScript
159
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill automattic/agent-skills --skill wp-wpcli-and-ops- SKILL.md3.9 KB
Overview
This skill provides operational guidance and scripts for using WP-CLI to manage WordPress sites safely and repeatably. It focuses on search-replace migrations, database export/import, plugin/theme/user management, cron and cache handling, multisite concerns, and automation with wp-cli.yml. Use it to standardize routine ops and reduce blast radius for destructive commands.
How this skill works
The skill inspects the execution environment and WP-CLI availability, then chooses a targeted workflow (safe search-replace, package operations, cron/queue inspection, multisite handling). It includes an inspector script to verify path and URL targeting, recommended sequences for backups and dry-runs, and patterns for scripting and CI-safe jobs. After changes, it verifies side effects and re-runs inspections.
When to use it
- Performing domain or protocol migrations with search-and-replace
- Exporting, importing, resetting, or inspecting the database
- Installing, activating, updating, or removing plugins and themes
- Debugging or running cron events and flushing caches or rewrites
- Running network-wide operations on a multisite or per-site changes
- Creating repeatable scripts, wp-cli.yml defaults, or CI jobs
Best practices
- Always confirm environment (dev/staging/prod) and get approval before writes
- Target the correct site with --path and --url; for multisite decide network vs single-site
- Take a DB export backup before risky operations and use --dry-run for search-replace
- Prefer wp-cli.yml and shell scripts that log and stop on error for repeatability
- Run focused cron events for debugging and avoid running all jobs blindly
- Re-run the inspector after changes and execute smoke tests or health checks
Example use cases
- Migrate a site from http to https: export DB, run wp search-replace --dry-run, then apply and flush caches
- Batch-update plugins across a multisite network with a scripted loop using --url or --network
- Debug a failing scheduled task by listing cron events and running a specific event
- Reset a staging database by importing a sanitized dump and verifying site URLs
- Add wp-cli.yml defaults to CI so read-only checks run automatically during pull requests
FAQ
Detect with the inspector; if missing, install via the project's documented tooling (Composer, container image, or package) or ask for the intended execution environment before proceeding.
How do I avoid affecting other sites on a multisite network?
Specify --url for a single site or use --network when you explicitly mean network-wide changes; test on a single site first and review scripts carefully.