Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
litespeed_wiki:cache:lscwp:wordpress_cli [2020/05/04 13:55] Shivam Saluja |
litespeed_wiki:cache:lscwp:wordpress_cli [2020/11/14 15:45] Lisa Clarke Redirect to new Documentation Site |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== WordPress CLI ====== | + | ~~REDIRECT>https://docs.litespeedtech.com/lscache/lscwp/cli/~~ |
- | **Please Note**: This wiki is valid for v2.9.x and below of the LiteSpeed Cache Plugin for WordPress. If you are using v3.0 or above, please see [[https://docs.litespeedtech.com/lscache/lscwp/overview/|the new documentation]]. | + | |
- | + | ||
- | WP-CLI is the command-line interface for WordPress. It allows you to perform many actions that would normally require visiting your WordPress Dashboard in a browser. The following commands are provided by LiteSpeed, so that you may manage your cache with the CLI. | + | |
- | + | ||
- | ===== Option Commands ===== | + | |
- | + | ||
- | ==== Set an option ==== | + | |
- | For example, set to not cache the login page: | + | |
- | <code>wp lscache-admin set_option cache_login false</code> | + | |
- | + | ||
- | + | ||
- | ==== Get all options ==== | + | |
- | <code>wp lscache-admin get_options</code> | + | |
- | + | ||
- | + | ||
- | ==== Export options to a file ==== | + | |
- | <code>wp lscache-admin export_options</code> | + | |
- | + | ||
- | + | ||
- | ==== Import options from ''CURRENTDIR/options.txt'' ==== | + | |
- | <code>wp lscache-admin import_options options.txt</code> | + | |
- | + | ||
- | + | ||
- | ===== Purge Commands ===== | + | |
- | + | ||
- | + | ||
- | ==== List all the site domains and ids in a table ==== | + | |
- | <code>wp lscache-purge network_list</code> | + | |
- | + | ||
- | + | ||
- | ==== Purge Everything associated with the WordPress install ==== | + | |
- | <code>wp lscache-purge all</code> | + | |
- | + | ||
- | + | ||
- | ==== 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''): | + | |
- | <code>wp lscache-purge blog 2</code> | + | |
- | + | ||
- | + | ||
- | ==== Purges all cache tags related to a url ==== | + | |
- | For example, purge the front page: | + | |
- | <code>wp lscache-purge url https://mysite.com/</code> | + | |
- | + | ||
- | + | ||
- | ==== Purges cache tags for a WordPress tag ==== | + | |
- | For example, purge the tag ids'' 1'', ''3'', and ''5'': | + | |
- | <code>wp lscache-purge tag 1 3 5</code> | + | |
- | + | ||
- | + | ||
- | ==== Purges cache tags for a WordPress category ==== | + | |
- | For example, purge the category ids ''1'', ''3'', and ''5'': | + | |
- | <code>wp lscache-purge category 1 3 5</code> | + | |
- | + | ||
- | + | ||
- | ==== Purges cache tags for a WordPress Post/Product ==== | + | |
- | For example, purge the post ids ''1'', ''3'', and ''5'' | + | |
- | <code>wp lscache-purge post_id 1 3 5</code> | + | |
- | + | ||
- | ===== Image Optimization Commands ===== | + | |
- | + | ||
- | ==== Removes original backups ==== | + | |
- | <code>wp lscache-iapi rm_bkup</code> | + |