WP-CLI & Ops

WordPress WP-CLI operations

A safety-first operations playbook for WP-CLI that makes WordPress migrations, DB operations and bulk changes repeatable and auditable. Built around a three-gate safety model: confirm environment and target, back up first, dry-run then execute: it specializes in serialization-safe search-replace, multisite targeting and CI/CD automation so you never break production with a wrong path, broken serialized data, or the wrong site.

$15 one-time
Add to a kit →

Prices include 20% VAT. · Forged on real agency work · one-time, no lock-in

  • Type Skill
  • Category DevOps & Infra
  • Delivery Email · instant
  • License One-time
Run preview
forgehouse, wp-wpcli-and-ops

Inside the run · no black box

See the actual work before you buy it.

One careless search-replace can corrupt every serialized option in the database. Three gates stand in front of that: environment confirmed, backup exported and verified, dry run read before anything real executes.

  1. Confirm the environment before anything else: wp option get siteurl must return the expected target, an environment guard refuses commands when the URL looks like production, and every multisite command carries an explicit url parameter so one site is hit, not fifty.
  2. Back up first, without exception: a timestamped wp db export before every destructive operation, with the file size verified above zero before proceeding.
  3. Dry-run the change: search-replace runs with dry-run and changed-only reporting, the affected row count is read and sanity-checked, and only then does the real run execute with precise mode and the guid column skipped.
  4. Never touch serialized data with raw SQL or sed; wp search-replace is serialization-aware and updates PHP byte-length wrappers correctly, while regex mode loses that protection and is treated as dangerous.
  5. Chain risky operations fail-secure: strict shell mode plus an error trap that re-imports the backup, so a failed plugin or core update rolls the site back automatically instead of leaving it half-broken.
  6. Close with the verification checklist: cache flush and rewrite flush, a smoke test of the homepage, admin panel and one sample post, and proof that the rollback file actually imports.
Use cases · what happens when you plug it in

One power source. 6 lines out.

wp-wpcli-and-ops · core

core active · 6 lines

  1. Domain/URL migration between staging and production

    ✓ domain/url migration bet…
  2. DB snapshot, import, export, reset and inspection

    ✓ db snapshot, import, exp…
  3. Plugin/theme install, update and network-wide activation

    ✓ plugin/theme install, up…
  4. Cron event inspection and manual debug triggers

    ✓ cron event inspection and
  5. Multisite site-specific or network-wide operations

    ✓ multisite site-specific or
  6. Post-deploy cache flush and rewrite refresh in CI/CD

    ✓ post-deploy cache flush
Benefits · what you walk away with

Yours to keep.

Drag time forward. Watch what stays.

Forever

That's what owning means.

The rented stack

ai writing tool: subscription

expired · access lost

analytics suite: subscription

expired · access lost

design platform: subscription

expired · access lost

(nothing left)

Your forge

  1. Serialization-safe search-replace prevents the white-screen corruption a naive sed/SQL replace causes

    license: perpetual
  2. Three-gate safety model (env check, backup, dry-run) stops destructive ops in the wrong environment

    license: perpetual
  3. Explicit --url targeting prevents one command from breaking all sites in a multisite network

    license: perpetual
  4. Trap-based rollback restores the DB automatically if any step in a risky chain fails

    license: perpetual

subscriptions expire · deeds don't

What's included · the full manifest

Everything in the box.

Pick a piece up. Watch it work.

Safe URL migration script (backup, dry-run, precise serialization-safe replace, cache/rewrite flush)

part 01 of 06 · in the box

6 parts · one working system · ships instantly by email

Who it's for

This wasn't forged for everyone.

  • Not for you if you'd rather rent a tool than own one.
  • Not for you if you want someone else to run your stack.
  • Not for you if you're happy guessing.
Still here? Good.

DevOps and WordPress operators running migrations, bulk operations or CI/CD automation who cannot afford a wrong-environment mistake.

then this was forged for you.

Works with

Universal by design: these run in any AI. Delivered in the open Agent Skills + MCP format (native in Claude); ChatGPT, Gemini, Cursor and Copilot adapt the same files their own way.

  • Claude Native format
  • ChatGPT Adapts via open standards
  • Gemini Adapts via open standards
  • Cursor Adapts via open standards
  • Copilot Adapts via open standards
Questions · still in the air

Catch what's on your mind.

the air is clear. nothing between you and the forge.
catch a spark: the forge will answer

  1. We deploy through CI/CD, does this fit automated pipelines or only manual terminal work?

    Both. It ships wp-cli.yml environment configs for @production/@staging targeting, post-deploy cache flush and rewrite refresh steps for CI/CD, and a platform-difference table covering local macOS, Linux/CI and containerized setups. The same three-gate safety model applies whether a human or a pipeline runs the command.

  2. How is its search-replace safer than running sed or raw SQL on the database?

    WordPress stores serialized PHP arrays whose string lengths are encoded in the data; a naive sed or SQL replace changes the string but not the length, corrupting the array and white-screening the site. The playbook uses WP-CLI's serialization-aware replace wrapped in backup and dry-run gates, plus trap-based rollback that restores the DB if a step fails.

  3. Will it stop me from ever breaking production?

    No tool can promise that, and this one does not. What it does is make the destructive moment hard to reach by accident: an environment guard refuses dangerous ops on production-looking URLs, backups are mandatory before changes, and dry-run precedes execute. A deliberate override is still your responsibility.

  4. How is it delivered?

    By email right after purchase: ready to run, downloaded instantly, no setup wait.

  5. One-time or subscription?

    A one-time purchase; no subscription or hidden fees. VAT (20%) is included.

  6. Can I get a refund?

    As a digital product, it can’t be refunded once downloaded. That’s why we show exactly what’s inside and who it’s for, right here.