WP-CLI Commands

MilliCache Pro extends the wp millicache command with everything the Pro modules can do. MilliCache's own commands (clear, stats, status, test, config, and friends) all keep working.

Quick Reference#Copied!

Command Description
wp millicache license status Show license state, seats, masked key
wp millicache license activate Activate a license key
wp millicache license deactivate Deactivate and free this install's seats
wp millicache license subsite-state Show/set a subsite's license mode (multisite)
wp millicache license install-id Show or reset the install identity
wp millicache module list List modules and their status
wp millicache module activate Activate a module
wp millicache module deactivate Deactivate a module
wp millicache entries List cached entries with filters
wp millicache rules <sub> Manage custom caching rules
wp millicache preload Preload the cache from the sitemap
wp millicache metrics seed Seed sample metrics data
wp millicache metrics clear Delete recorded metrics
wp millicache edge <sub> Test, inspect, and purge the edge cache
wp millicache cdn status Show the Asset CDN configuration
wp millicache object-cache <sub> Manage the object cache drop-in

On multisite, commands that touch settings accept --network to address the network scope. Commands for network-owned modules (Edge Cache, Asset CDN, Object Cache) read the owning scope automatically. Use WP-CLI's global --url=<site-url> to run in a specific site's context.


License#Copied!

wp millicache license status#Copied!

 1wp millicache license status [--network] [--format=<format>]
Option Description
--network Multisite: list every subsite's license mode plus a network summary
--format=<format> table, json, csv, yaml (default: table)

wp millicache license activate#Copied!

 1wp millicache license activate [--key=<key>]

Saves the key and activates it; without --key, an already-saved key is activated. On multisite this activates the network license covering all active subsites.

wp millicache license deactivate#Copied!

 1wp millicache license deactivate

Frees this install's activation seats, for example before migrating to a new domain.

wp millicache license subsite-state#Copied!

 1wp millicache license subsite-state <blog_id> [<state>]

Show or set a subsite's license mode on multisite: network, own_key, or opted_out.

wp millicache license install-id#Copied!

 1wp millicache license install-id [show|reset]

Shows or resets the install's identity. Reset it on a cloned site so the clone activates as its own install.


Modules#Copied!

wp millicache module#Copied!

 1wp millicache module list [--format=<format>]
 2wp millicache module activate [<module>]
 3wp millicache module deactivate [<module>]

list shows every toggleable module with its status. activate and deactivate take the module key (for example preload); without one, they prompt interactively.

 1wp millicache module list
 2wp millicache module activate preload
 3wp millicache module deactivate cdn --network

Cache Entries#Copied!

wp millicache entries#Copied!

 1wp millicache entries [--search=<term>] [--flag=<pattern>] [--type=<type>]
 2                      [--post-type=<type>] [--status=<status>] [--gzip=<gzip>]
 3                      [--orderby=<field>] [--order=<order>]
 4                      [--fields=<fields>] [--format=<format>]

Lists cached entries with the same filters as the Entries browser, where the options are documented in full.

 1wp millicache entries --flag="post:*"
 2wp millicache entries --type=singular --post-type=page --format=json

Rules#Copied!

wp millicache rules#Copied!

 1wp millicache rules list [--format=<format>]
 2wp millicache rules get <id> [--format=<format>]
 3wp millicache rules enable <id>
 4wp millicache rules disable <id>
 5wp millicache rules delete <id>
 6wp millicache rules export [--file=<file>]
 7wp millicache rules import <file> [--replace]

Manages the custom rules from the Rules builder. import appends and skips duplicate IDs by default; --replace swaps out all existing custom rules.

 1wp millicache rules export --file=rules.json
 2wp millicache rules import rules.json --replace

Preloading#Copied!

wp millicache preload#Copied!

 1wp millicache preload [--uri=<uri>] [--dry-run] [--async]
Option Description
--uri=<uri> Preload a single URI (path or full URL) instead of the full sitemap
--dry-run List URLs that would be preloaded without requesting them
--async Enqueue for background processing instead of preloading synchronously
 1wp millicache preload
 2wp millicache preload --uri=https://example.com/about/
 3wp millicache preload --dry-run
 4wp millicache preload --async

Metrics#Copied!

wp millicache metrics seed#Copied!

 1wp millicache metrics seed [--days=<days>] [--clear]

Fills the metrics history with plausible sample data so the dashboard has something to chart on a fresh install.

Option Description
--days=<days> How many days of daily history to generate (max 365, default 7)
--clear Wipe existing metrics before seeding

wp millicache metrics clear#Copied!

 1wp millicache metrics clear

Deletes all recorded metrics for the current site.


Edge Cache#Copied!

wp millicache edge#Copied!

 1wp millicache edge status
 2wp millicache edge test
 3wp millicache edge purge [--all] [--flag=<flag>] [--uri=<uri>]

status shows the provider and configuration state, test verifies the credentials against the zone, and purge purges synchronously:

Option Description
--all Purge the entire pull zone
--flag=<flag> Purge every edge object tagged with this flag; comma-separated list allowed
--uri=<uri> Purge a specific media URL; trailing * requests a prefix purge
 1wp millicache edge purge --all
 2wp millicache edge purge --flag=post:123,home

Asset CDN#Copied!

wp millicache cdn status#Copied!

 1wp millicache cdn status

Prints the configured hostname, enabled state, and the directory, extension, and exclusion lists.


Object Cache#Copied!

wp millicache object-cache#Copied!

 1wp millicache object-cache status
 2wp millicache object-cache enable
 3wp millicache object-cache disable
 4wp millicache object-cache flush

enable installs the drop-in and switches the module on (refusing while a foreign object-cache.php is installed); disable switches it off and removes MilliCache's own drop-in; flush clears the object cache without touching cached pages.

wp millicache drop#Copied!

 1wp millicache drop                        # reinstall all drop-ins
 2wp millicache drop object-cache --force   # force-reinstall just the object cache
 3wp millicache drop --force                # force-reinstall everything

Reinstalls MilliCache's drop-in files in wp-content — ideal for CD pipelines where symlinks break between deploys. With no name it covers both advanced-cache and (with the object cache switched on) object-cache; pass a name to target one. --force rewrites the drop-in even when it looks current and cold-starts the object cache so no stale entries survive. A third-party object-cache.php is always left in place.


Next Steps#Copied!

Last updated: