wp-wpcli-and-ops

Opérations et automatisation WordPress via WP-CLI avec recherche-remplacement sécurisé, gestion de base de données et support multisite. Couvre la recherche-remplacement pour les migrations de domaine, l'exportation/importation de base de données, la gestion des plugins/thèmes/utilisateurs, l'inspection des tâches planifiées et le vidage du cache. Inclut des garde-fous intégrés : confirmation d'environnement, validation en mode test et workflows de sauvegarde avant les opérations destructrices. Prend en charge les opérations multisites avec ciblage par site ( --url ) et par réseau ( --network ). Permet...

npx skills add https://github.com/wordpress/agent-skills --skill 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.

Plus de skills de wordpress

blueprint
wordpress
À utiliser lors de la création, de l'édition ou de la révision de fichiers JSON de blueprint WordPress Playground. Se déclenche sur les mentions de blueprints, de configuration playground ou de demandes…
official
wordpress-router
wordpress
We need to translate the given text from English to French. The text describes a skill called "wordpress-router" but the instruction says to translate only the text inside <text> and not include the name unless it appears in the source text. The name "wordpress-router" does not appear in the source text, so we don't include it. We preserve product names, protocol names, URLs, numbers, technical terms. So "WordPress", "PHP", "WP-CLI", "Gutenberg", "bash", "Node", "6.9+", "7.2.24+" should remain as is. Also "plugin", "themes", "blocks", "core checkouts", "repo type", "plugin, theme, block theme, Gutenberg blocks, WP core" are technical terms. We translate the rest naturally. The text: "Classify WordPress codebases and route to the correct workflow for plugins, themes, blocks, and core checkouts. Runs automated project triage to identify repo type (plugin, theme, block theme, Gutenberg blocks
official
wp-abilities-api
wordpress
We need to translate the given text from English to French. The text describes a WordPress Abilities API. We must preserve the name "wp-abilities-api" but it's not in the text. The text includes technical terms like "REST", "PHP", "JavaScript", "WordPress 6.9+", "wp_register_ability()", "wp_register_ability_category()", "/wp-json/wp-abilities/v1/", "meta.show_in_rest", "@wordpress/abilities". We should not add any extra commentary or labels. Just translate the text inside <text> to French. Let's translate: "WordPress Abilities API registration, REST exposure, and client-side consumption for WordPress 6.9+. Register abilities and categories in PHP using wp_register_ability() and wp_register_ability_category() with stable IDs, labels, and metadata Expose abilities to clients via the /wp-json/wp-abilities/v1/ REST endpoints by setting meta.show_in_rest: true Consume abilities in JavaScript using the @wordpress
official
wp-abilities-audit
wordpress
Audit a WordPress plugin's REST surface and produce a standardized audit document proposing Abilities API registrations. Produces a markdown doc with a YAML…
official
wp-abilities-verify
wordpress
Verify a WordPress plugin's Abilities API registrations: enumerate abilities, check that callback behavior matches each annotation's claim (the adversarial…
official
wp-block-development
wordpress
Développement de blocs WordPress pour Gutenberg : métadonnées, enregistrement, rendu et workflows de build. Couvre la création de blocs, la configuration block.json, le rendu statique vs dynamique, et l'enregistrement PHP côté serveur avec register_block_type_from_metadata(). Impose apiVersion: 3 pour la compatibilité WordPress 6.9+, incluant le support de l'éditeur iframe et l'isolation des styles. Gère la sérialisation des attributs, les dépréciations/migrations pour éviter les erreurs "Invalid block", et la composition de blocs internes. Inclut...
official
wp-block-themes
wordpress
Développement de thèmes bloc WordPress : theme.json, templates, motifs et dépannage de l'éditeur de site. Couvre l'édition de theme.json (préréglages, paramètres, styles par bloc), les templates et parties de template, les motifs et les variations de style pour WordPress 6.9 et versions ultérieures. Inclut des scripts de triage pour détecter les racines de thème et la structure des thèmes bloc, ainsi que des procédures guidées pour créer de nouveaux thèmes ou convertir des thèmes classiques. Fournit des workflows de débogage pour les problèmes de hiérarchie de style, les remplacements de personnalisation utilisateur et l'éditeur de site...
official
wp-interactivity-api
wordpress
Utiliser lors de la construction
official