WP-CLI Commands
xSpeed Cache registers a set of WP-CLI commands so you can check status, purge caches, and run tasks from the command line. Every command lives under the wp xspeed namespace.
What this does
Each xSpeed Cache module that supports the command line adds its own wp xspeed <module> ... command. The commands share the same code as the dashboard, so what you see on the command line matches what the dashboard does.
The commands are only available when WP-CLI is installed and you run them from a site where xSpeed Cache is active. Some commands belong to xSpeed Cache Pro and only appear when Pro is installed and licensed.
How to use them
Run the commands from your site’s root directory, the same way you run any other wp command.
wp xspeed cache status
If a command takes an action, you pass it as the first word after the command name:
wp xspeed objcache flush
Some commands accept extra options written as --name=value:
wp xspeed db clean --types=transients,revisions
Note: Run
wp xspeed <command> --helpto see the exact actions and options WP-CLI has registered for any command on your install.
Free commands
These commands ship with the free xSpeed Cache plugin.
| Command | What it does | Actions |
|---|---|---|
wp xspeed cache | Inspect Cache module settings | status (optional) |
wp xspeed minify | Inspect or purge the minify cache | status, purge |
wp xspeed gzip | Show GZIP status (server type, active, mode) | — |
wp xspeed browser-cache | Print the Apache or nginx browser-cache snippet | apache, nginx (optional) |
wp xspeed objcache | Manage object cache | status, flush, snippet, enable, disable, test |
wp xspeed db | Scan or clean WordPress bloat | scan, clean, optimize |
wp xspeed preloader | Drive the cache preloader | start, stop, status |
wp xspeed cdn | Show CDN settings and test rewriting a URL | status, test |
wp xspeed cf | Cloudflare verify, purge, and dev-mode helpers | verify, purge, dev-on, dev-off |
wp xspeed lazy | Show which lazy-load toggles are active | — |
wp xspeed fonts | Show font-optimization settings | — |
wp xspeed bloat | Show which bloat-removal toggles are active | — |
wp xspeed heartbeat | Inspect or modify heartbeat settings | show, set |
wp xspeed health | Print diagnostic checks, cache stats, and recent activity | — |
wp xspeed ai-privacy | Show whether AI data collection is allowed for the current context | — |
wp xspeed migrate | Import settings from another caching plugin | status, preview, apply |
wp xspeed support | Print the support snapshot | — |
Cache
wp xspeed cache status prints the current Cache module settings, including the cache lifetime and the list of excluded URLs. Purging and toggling the cache are handled by the dedicated commands rather than this one.
Minify
wp xspeed minify status
wp xspeed minify purge
status shows the state of the minify cache. purge clears it.
GZIP
wp xspeed gzip reports the detected server type, whether GZIP is active, and the mode (auto on Apache and LiteSpeed, manual on nginx and IIS).
Browser cache
wp xspeed browser-cache apache
wp xspeed browser-cache nginx
This prints the browser-cache snippet for the chosen server. If you do not pass a flavor, it prints the Apache rules.
Object cache
wp xspeed objcache status
wp xspeed objcache flush
wp xspeed objcache snippet
wp xspeed objcache test
wp xspeed objcache enable
wp xspeed objcache disable
status shows whether the drop-in is installed and which backend is in use. flush clears the object cache. snippet prints the wp-config.php snippet. test checks the connection to the configured backend. enable installs the drop-in and writes the config; disable reverses it.
Database
wp xspeed db scan
wp xspeed db clean --types=transients,revisions
wp xspeed db optimize
scan reports the bloat it finds. clean removes it. Use --types=a,b to clean specific categories only. optimize runs table optimization.
Preloader
wp xspeed preloader start
wp xspeed preloader stop
wp xspeed preloader status
start begins a preload run, stop ends it, and status reports progress.
CDN
wp xspeed cdn status
wp xspeed cdn test --url=https://example.com/wp-content/uploads/image.jpg
status shows the current CDN settings. test rewrites the URL you pass in --url so you can confirm the CDN rewrite is working.
Cloudflare
wp xspeed cf verify
wp xspeed cf purge
wp xspeed cf dev-on
wp xspeed cf dev-off
verify checks your Cloudflare credentials. purge clears the Cloudflare cache. dev-on and dev-off turn Cloudflare development mode on and off.
Heartbeat
wp xspeed heartbeat show
wp xspeed heartbeat set --for=editor --behavior=disable
show prints the current heartbeat settings. set changes them. Use --for to choose the context, --behavior to set the behavior, and --frequency to set the interval.
Note: This command uses
--forrather than--context.
Migration
wp xspeed migrate status
wp xspeed migrate preview --source=wp-rocket
wp xspeed migrate apply --source=wp-rocket
status shows what can be imported. preview shows what would change without applying it. apply imports the settings. Use --source to name the plugin to import from.
Read-only status commands
wp xspeed lazy, wp xspeed fonts, and wp xspeed bloat each print which toggles in that module are currently active. wp xspeed health prints diagnostic checks, cache stats, and recent activity in one view. wp xspeed ai-privacy shows whether AI data collection is allowed for the current request context. On the command line there is no consent cookie, so this reflects the no-cookie case.
Support
wp xspeed support prints the support snapshot, a read-only system-info dump you can paste into a support ticket. See Debug Mode and Logs for what it contains.
Pro commands
These commands appear only when xSpeed Cache Pro is installed and licensed.
| Command | What it does | Actions |
|---|---|---|
wp xspeed pro | Show xSpeed Cache Pro version and integration status | — |
wp xspeed license status | Show license status, expiry, and grace window | — |
wp xspeed brand | Show resolved branding for the current site | — |
wp xspeed images | Show image conversion capabilities or convert a file | caps, convert |
wp xspeed ccss | Manage Critical CSS storage | list, clear, generate |
wp xspeed ucss | Manage Unused CSS storage | list, clear, generate |
wp xspeed psi | Run a PageSpeed Insights audit on a URL | — |
wp xspeed rum | Show recent RUM metric percentiles | — |
wp xspeed recs | List recommendations for the current configuration | — |
wp xspeed rules | List custom cache rules | — |
wp xspeed analytics | Show overview or slowest URLs | overview, slowest |
wp xspeed network | Network-wide site snapshots and purge (multisite) | list, purge |
wp xspeed cf-apo | Cloudflare APO and edge-cache settings | status, on, off, sync |
wp xspeed ai status | Show configured AI provider and usage counters | — |
wp xspeed ai test | Send a tiny test prompt to verify the AI provider | — |
wp xspeed smart-predict analyze | Re-compute predictions from the navigation buffer | — |
wp xspeed smart-predict status | Show buffer size, indexed sources, last analysis time | — |
wp xspeed smart-predict flush | Wipe the SmartPredict buffer and predictions | — |
wp xspeed smart-image status | Show the library profile and current AI recommendation | — |
wp xspeed smart-image analyze | Re-profile the library and ask the AI for a recommendation | — |
wp xspeed smart-image apply | Apply the recommendation into the Images module | — |
wp xspeed adaptive-cache status | Show traffic profile and TTL recommendation | — |
wp xspeed adaptive-cache analyze | Re-profile traffic and refresh the AI rationale | — |
wp xspeed adaptive-cache apply | Apply the recommended TTL into the Cache module | — |
wp xspeed performance-health status | Show Core Web Vitals score and any anomalies | — |
wp xspeed performance-health analyze | Re-compute status and refresh the AI narrative | — |
Images
wp xspeed images caps
wp xspeed images convert --file=/path/to/image.jpg --format=webp
caps shows which image conversion capabilities your server has. convert converts an existing file. Use --file for the path and --format to choose webp or avif.
Critical CSS and Unused CSS
wp xspeed ccss list
wp xspeed ccss clear
wp xspeed ccss generate --url=https://example.com/
wp xspeed ucss list
wp xspeed ucss clear
wp xspeed ucss generate --url=https://example.com/
Both commands work the same way. list shows stored entries, clear removes them, and generate builds a new entry. Use --url to target a specific page.
PageSpeed Insights
wp xspeed psi --url=https://example.com/ --strategy=mobile
wp xspeed psi --url=https://example.com/ --force
Runs a PageSpeed Insights audit. --strategy accepts mobile or desktop. Add --force to skip any cached result and run a fresh audit.
RUM
wp xspeed rum --hours=24
Shows recent Real User Monitoring metric percentiles. Use --hours to set the time window.
Analytics
wp xspeed analytics overview
wp xspeed analytics slowest --metric=ttfb
overview shows a summary. slowest lists the slowest URLs. Use --metric to pick which metric to sort by.
Multisite network
wp xspeed network list
wp xspeed network purge --blog=2
list shows a snapshot of each site in the network. purge clears the cache. Use --blog to target a single site.
Cloudflare APO
wp xspeed cf-apo status
wp xspeed cf-apo on
wp xspeed cf-apo off
wp xspeed cf-apo sync
status reports the current APO and edge-cache settings. on and off toggle APO. sync pushes the current settings to Cloudflare.
AI commands
wp xspeed ai status shows the configured AI provider and usage counters. wp xspeed ai test sends a small test prompt to confirm the provider is reachable.
The SmartPredict, SmartImage, AdaptiveCache, and PerformanceHealth commands each follow the same pattern: a status view, an analyze action that recomputes the result, and (where it applies) an apply action that writes the recommendation into the matching module.
Related
- A Tour of the xSpeed Cache Dashboard
- Server Compatibility
- Debug Mode and Logs
- Object Cache
- CDN Integration