Mamba WP-CLI Reference

Mamba provides a set of powerful WP-CLI commands for cache management and warmup operations. These allow you to purge, warm, and inspect cache state directly from the command line.

All commands are under the wp mamba namespace.


Notes

  • Run commands from your WordPress root directory, or pass --path=/absolute/path/to/wordpress to each command.
  • You can configure a global default path in ~/.wp-cli/config.yml: path: /absolute/path/to/wordpress

Purge Commands

Purge all
Clears the entire page cache and resets statistics. If page cache is enabled, a warmup job is scheduled.

wp mamba purge all [--path=/path/to/wp]

Purge Store API
Clears the Store API cache (file cache and legacy transients) and triggers related CDN tag purges.

wp mamba purge store-api [--path=/path/to/wp]

Purge one URL
Purges a single, same-origin URL. Optionally warms that URL.

wp mamba purge url "https://yoursite.com/sample-page/" [--and-warm] [--path=/path/to/wp]

Purge multiple URLs from file
Purges all URLs listed in a file (one per line). Optionally warms each URL.

wp mamba purge urls /absolute/path/to/urls.txt [--and-warm] [--path=/path/to/wp]

Purge product-related
Smart invalidation for a product ID, covering product pages, related categories, shop/home, Store API, and CDN tags. Also schedules a warmup.

wp mamba purge product <product_id> [--path=/path/to/wp]

Purge a category
Purges the category archive URL (resolved from term_id). Optionally warms it.

wp mamba purge category <term_id> [--and-warm] [--path=/path/to/wp]

Purge shop page
Purges the shop page (common variations). Optionally warms it.

wp mamba purge shop [--and-warm] [--path=/path/to/wp]

Purge homepage
Purges the site homepage. Optionally warms it.

wp mamba purge home [--and-warm] [--path=/path/to/wp]

Purge CDN tags
Purges CDN caches by tags. This does not remove page cache files directly.

wp mamba purge tags "tag1,tag2,tag3" [--path=/path/to/wp]

Warmup Commands

Start warmup
Starts a warmup job that builds and expands the URL list, then processes it in batches.

wp mamba warmup start [--path=/path/to/wp]

Warmup status
Shows the status of the most recent warmup job, including state (idle/running), progress, and counts.

wp mamba warmup status [--path=/path/to/wp]

Cancel warmup
Cancels the most recent warmup job.

wp mamba warmup cancel [--path=/path/to/wp]

Resume warmup
Resumes a paused warmup job (if applicable).

wp mamba warmup resume [--path=/path/to/wp]

Warmup errors
Prints the last collected warmup errors (up to 100 entries).

wp mamba warmup errors [--path=/path/to/wp]

Examples

# Purge Store API
wp mamba purge store-api --path=/var/www/wordpress

# Purge a URL and warm it
wp mamba purge url "https://yoursite.com/shop/" --and-warm --path=/var/www/wordpress

# Start and check warmup
wp mamba warmup start --path=/var/www/wordpress
wp mamba warmup status --path=/var/www/wordpress

Copyright 2025 - Mamba


Mamba mascot