WP-CLI commands

All eight wp wppo command families, dry runs, destructive gates, and redacted output guidance.

2 min readPart of Performance Optimisation

The plugin registers eight wp wppo command families. Run commands as a user with the capabilities required by the operation and review destructive previews before applying them.

Command map

CommandActionsNotes
cacheclear, preload, status--page= accepts a page URL or path for a targeted clear.
databasecleanup, optimize, countsCleanup supports nine types, --dry-run, and --yes for an all-type run.
imagestatus, convertConversion honors the configured format and bounded batch size.
settingsget, update, export, importExports and reads redact secret-shaped values; imports validate the canonical tab allowlist.
object-cachestatus, ping, enable, disable, flushConnection arguments are validated by the Redis configuration policy.
pagespeedscan, resultsRequires a configured PageSpeed key for a remote scan.
system-infoJSON groups or the full reportUse for redacted diagnostics; do not paste secrets into reports.
verifyRead-only live-state gatesChecks cache directories, drop-ins, Redis, LiteSpeed, settings schema, cron, and uninstall hygiene.

Common examples

wp wppo cache clear
wp wppo cache clear --page=/sample-page/
wp wppo cache preload
wp wppo database cleanup --type=revisions --dry-run
wp wppo database counts
wp wppo image status
wp wppo settings get file_optimisation
wp wppo settings update file_optimisation --settings=\'{\"minifyHTML\":true}\'
wp wppo object-cache status
wp wppo pagespeed scan --url=https://example.com --strategy=mobile
wp wppo verify --format=json

Destructive operations

Use --dry-run before database cleanup. The all-type cleanup asks for confirmation in an interactive terminal and accepts --yes for automation. Disabling the Redis drop-in is also confirmation-gated. Keep an export and a staging test before importing settings or changing server rules.

Output and secrets

Commands return JSON where documented and redact password/API-key-shaped values from settings reads and exports. Do not add a wrapper that prints raw options, request headers, cookies, or environment variables.