This is an old revision of the document!
WordPress CLI
Option Commands
Set an option
For example, set to not cache the login page:
wp lscache-admin set_option cache_login false
Get all options
wp lscache-admin get_options
Export options to a file
wp lscache-admin export_options
Import options from ''CURRENTDIR/options.txt''
wp lscache-admin import_options options.txt
Purge Commands
List all the site domains and ids in a table
wp lscache-purge network_list
Purge Everything associated with the WordPress install
wp lscache-purge all
Purges all cache entries for the blog
For example, in a multisite install, purge only the shop.example.com
cache (stored as blog id 2
):
wp lscache-purge blog 2
Purges all cache tags related to a url
For example, purge the front page:
wp lscache-purge url https://mysite.com/
Purges cache tags for a WordPress tag
For example, purge the tag ids 1
, 3
, and 5
:
wp lscache-purge tag 1 3 5
Purges cache tags for a WordPress category
For example, purge the category ids 1
, 3
, and 5
:
wp lscache-purge category 1 3 5
Purges cache tags for a WordPress Post/Product
For example, purge the post ids 1
, 3
, and 5
wp lscache-purge post_id 1 3 5