Wp wpcli and ops

From wpgaurav/WordPress-skills · View interactive version

Wp wpcli and ops is an AI agent skill from the GitHub repository wpgaurav/WordPress-skills. Use when working with WP-CLI (wp) for WordPress operations: safe search-replace, db export/import, plugin/theme/user/content management, cron, cache flushing, multisite, and scripting/automation with wp-cli.yml.

How to use this skill

Skill file

From Agent Skills for WordPress. Copyright (C) 2026 WordPress Contributors, licensed under GPL-2.0-or-later. Changed from upstream: the compatibility: frontmatter line was dropped when this copy was made in March 2026, and license frontmatter plus this notice were added on 2026-10-24. See NOTICE.md.

WP-CLI and Ops

When to use

Use this skill when the task involves WordPress operational work via WP-CLI, including:

Inputs required

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:

1) Inspect WP-CLI and site targeting (deterministic)

Run the inspector:

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:

B) Plugin/theme operations

Use wp plugin * / wp theme * and confirm you’re acting on the intended site (and network) first.

Read:

C) Cron and queues

Inspect cron state and run individual events for debugging rather than “run everything blindly”.

Read:

D) Multisite operations

Multisite changes can affect many sites. Always decide whether you’re operating:

Read:

3) Automation patterns (scripts + wp-cli.yml)

For repeatable ops, prefer:

Read:

Verification

Failure modes / debugging

See:

Escalation

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.