All skills
wordpress avatar

/wp-wpcli-and-ops

@20324d2 official
by wordpresswordpress/agent-skills2.2k stars
327

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.

Use this Skill: https://skilld.dev/gh/wordpress/agent-skills/wp-wpcli-and-ops

This session only. Nothing lands on disk.

referencessafety.md

≈201 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Safety rules (WP-CLI)

Use this file before running any write operations.

Golden rules

  • Assume production is unsafe unless explicitly confirmed.
  • Always confirm targeting:
    • --path (WordPress root)
    • --url (multisite / specific site targeting)
  • Prefer a backup (wp db export) before risky operations.
  • Prefer --dry-run where available (especially search-replace).

High-risk commands (require explicit confirmation)

  • wp db reset
  • wp db import (overwrites data)
  • wp search-replace (can affect serialized data and URLs)
  • bulk deletes (wp post delete --force --all, wp user delete --reassign, etc.)
  • plugin/theme mass updates on production

Logging

For ops scripts, log:

  • date/time
  • environment (dev/staging/prod)
  • exact WP-CLI commands
  • exit codes

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides operational guidance and utility scripts for managing WordPress sites using WP-CLI. No security vulnerabilities or malicious behaviors were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    9/9 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 20324d2. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 3 months ago
Other metadata
compatibility
Targets WordPress 7.0+ (PHP 7.4.0+). Requires WP-CLI in the execution environment.
  • Database
  • DevOps
  • wordpress
  • wp-cli
  • migrations
  • multisite
  • search-replace
  • automation
  • php

README badge

README badge for wordpress/agent-skills/wp-wpcli-and-ops

Operates WordPress sites via WP-CLI commands: safe search-replace for domain migrations, plugin/theme management, database export/import, cron inspection, cache flushing, and multisite operations. Targets WordPress 6.9+ and requires WP-CLI in the execution environment; includes guardrails to prevent destructive commands on wrong environments.

Generated from the current SKILL.md.

Does this skill work with WordPress versions before 6.9?
No. The skill targets WordPress 6.9+ with PHP 7.2.24+. Older versions are not supported.
Can I use this skill on production without a backup?
The skill requires confirming environment safety and making backups before risky operations like search-replace or database modifications. Running destructive commands on production without a backup is explicitly warned against.
Does this skill handle multisite operations?
Yes. The skill includes procedures for multisite, including single-site targeting with `--url=` and network-wide operations with `--network`, but you must explicitly specify which scope you intend.
What if WP-CLI is not installed in my environment?
The skill includes an inspector script to check for WP-CLI availability. If it's not found, you need to install it via Composer, a container, or system package manager before proceeding.
Can this skill automate WordPress operations with scripts?
Yes. The skill covers automation via `wp-cli.yml` configuration files, shell scripts with error handling, and CI job patterns for repeatable operational tasks.

Generated from the current SKILL.md. These answers refresh after source changes.