Skip to content
EdgeServers
Blog

WP-CLI operations at scale — running 200 WordPress sites from one terminal

May 27, 2026 · 1 min read · by Sudhanshu K.

WP-CLI is one of the most under-appreciated tools in the WordPress ecosystem. For a single site, it saves you a few clicks. For a hundred sites, it's the difference between "we have an ops team" and "we don't have an ops function at all."

The pattern that scales: a flat-file site inventory + a thin wrapper script + a small library of recipes that compose on top.

The wrapper

#!/bin/bash
# /usr/local/bin/wp-fleet
CUSTOMER=$1; shift
LINE=$(grep "^${CUSTOMER}\b" /etc/edge/wp-fleet.tsv)
HOST=$(echo "$LINE" | awk '{print $2}')
PATH_=$(echo "$LINE" | awk '{print $3}')
ssh -q "$HOST" "sudo -u www-data wp --path=$PATH_ $*"
# Fleet-wide WordPress core audit
for c in $(awk '{print $1}' /etc/edge/wp-fleet.tsv); do
  wp-fleet "$c" core version
done

Now a Monday-morning question — "which of our sites are running stale WordPress?" — is a 90-second script, not 200 dashboard logins.

The full write-up covers:

  • The TSV inventory format and why it lives in git
  • Dry-run discipline for fleet-wide plugin updates (one customer at a time)
  • The admin-user audit query (every WordPress admin across every site, in 30 seconds)
  • search-replace at scale, including the --skip-columns=guid rule
  • Coordinated maintenance-mode windows across the fleet
  • wp doctor check --all as a nightly smoke test

We run this exact pattern on every managed WordPress fleet.

Full article available

Read the full article