Documentation

WP-CLI workflows

Purge cache, preload pages, inspect status, and automate WP Cache Pro from the command line.

WP Cache Pro registers the wp wcp command when WP-CLI is available. It is useful for deployments, cron-driven maintenance, remote operations, and repeatable troubleshooting.

Purge cache

Purge the full local page cache:

wp wcp purge

Purge a post or URL:

wp wcp purge --post=42
wp wcp purge --url=https://example.com/about/

Include Cloudflare or generated Used CSS:

wp wcp purge --cloudflare
wp wcp purge --used-css

Preview a purge without changing anything:

wp wcp purge /contact/ /pricing/ --dry-run

Preload cache

Queue a background preload:

wp wcp preload

Run all batches synchronously and wait for completion:

wp wcp preload --wait

Temporarily change the batch size:

wp wcp preload --batch-size=20 --wait

Inspect preload status as JSON:

wp wcp preload --status --format=json

Status and automation

The command class also includes status, image optimization, database optimization, module management, option management, and .htaccess regeneration workflows. Use WP-CLI help on the installed version to see the exact options available:

wp help wcp
wp help wcp purge
wp help wcp preload

For production automation, prefer explicit flags and use --dry-run where available before adding destructive maintenance operations to a deployment pipeline.