- Your cart is currently empty.
WP-CLI: Commands for Managing LiteSpeed Cache
WP-CLI is a command line interface for the popular CMS – WordPress. It is primarily aimed at developers and other webmasters who want to manage their website (or a network of multiple websites) without using a browser or logging into the WordPress administration.
In the following, you will learn about WP-CLI commands for managing the WordPress plugin LiteSpeed Cache, which is responsible for ensuring efficient caching at server level. All web hosting users can try out the commands and benefit from the lightning-fast LiteSpeed web server.
Table of contents
- Commands for settings management
- Commands for clearing the cache
- Image optimisation commands
- QUIC.cloud management commands
- Debug commands
Commands to manage settings
Commands related to settings start with litespeed-option.
Specifying a setting value
Command: litespeed-option set
Parameters:
<key>– the setting to be changed<newvalue>– the value to set to the setting
# Example (1)
wp litespeed-option set cache-priv false
# Example (2)
wp litespeed-option set 'cdn-mapping[url][0]' https://cdn.example.com/
Getting the value of the setting
Command: litespeed-option get
Parameter: <key> – the setting from which to get the value
# Example (1)
wp litespeed-option get cache-priv
# Example (2)
wp litespeed-option get 'cdn-mapping[url][0]'
Get all settings values
Displays a list of all settings and their associated values.
Command: litespeed-option all
Parameter: /
# Example
wp litespeed-option all
Export settings
If no path is specified, all settings are exported to CURRENTDIR/lscache_wp_options_DATE-TIME.txt.
Command: litespeed-option export
Parameter: [--filename=<path>] – specify an alternate path for exporting settings (OPTIONAL)
# Example
wp litespeed-option export
Import settings
To import settings from a specific file. Each setting must be written on its own line, as option_key=option_value. If you want to use a comment, add a ; (semicolon) to the beginning of the line. Lines with comments are not executed.
Command: litespeed-option import
Parameter: <file> – import settings file
# Example
wp litespeed-option import options.txt
Restore settings to their original state
Restores all settings to factory defaults.
Command: litespeed-option reset
Parameter: /
# Example
wp litespeed-option reset
Cache clearing commands
Commands related to clearing the cache start with litespeed-purge.
Displaying domains in the network
Displays all domains and their IDs in the network.
Command: litespeed-purge network_list
Parameter: /
# Example
wp litespeed-purge network_list
Clear network cache
Clears the cache of the entire network of sites.
Command: litespeed-purge all
Parameter: /
# Example
wp litespeed-purge all
Clear blog cache
Clears the cache of a single web page in the network.
Command: litespeed-purge blog
Parameter: <blogid> – ID of the web page where you want to clear the cache
# Example
wp litespeed-purge blog 3
Clearing category cache
Clears the cache for the selected categories.
Command: litespeed-purge category
Parameter: <ids> – IDs of the categories for which you want to clear the cache
# Example
wp litespeed-purge category 2 4 6
Clear tag cache
Clears the cache for the selected tags.
Command: litespeed-purge tag
Parameter: <ids> – IDs of the tags for which you want to clear the cache
# Example
wp litespeed-purge tag 3 5 7
Clearing the post cache
Clears the cache for selected posts.
Command: litespeed-purge post_id
Parameter: <ids> – IDs of the posts for which you want to clear the cache
# Example
wp litespeed-purge post_id 4 7 9 11
Image optimization commands
The commands related to image optimisation start with litespeed-image.
Sending images for optimization
Sends a request for image optimisation to the QUIC.cloud server.
Command: litespeed-image push
Parameter: /
# Example
wp litespeed-image push
Download optimised images
Downloads optimised images from the QUIC.cloud server.
Command: litespeed-image pull
Parameter: /
# Example
wp litespeed-image pull
Get image optimization status
Displays the optimisation status based on local environment data.
Command: litespeed-image status or litespeed-image s
Parameter: /
# Example
wp litespeed-image status
Cleaning non-optimised images
Clear non-optimised images on the QUIC.cloud server.
Command: litespeed-image clean
Parameter: /
# Example
wp litespeed-image clean
Removing the original backup
Remove original image backups.
Command: litespeed-image rm_bkup
Parameter: /
# Example
wp litespeed-image rm_bkup
QUIC.cloud management commands
Commands related to QUIC.cloud web services start with litespeed-online.
API key generation
Generates an anonymous domain API key for secure communication with the QUIC.cloud server.
Command: litespeed-online init
Parameter: /
# Example
wp litespeed-online init
Data synchronisation
Synchronises the usage data of the QUIC.cloud service.
Command: litespeed-online sync
Parameter: /
# Example
wp litespeed-online sync
QUIC.cloud service demonstration
Displays all QUIC.cloud services.
Command: litespeed-online services
Parameter: /
# Example
wp litespeed-online services
Show nodes in use
Displays all QUIC.cloud nodes that are currently active.
Command: litespeed-online nodes
Parameter: /
# Example
wp litespeed-online nodes
Detects the nearest node in use
Detects the closest active QUIC.cloud node for a given service.
Command: litespeed-online ping
Parameter: <service> – the service for which you want to find the node
# Example
wp litespeed-online ping img_optm
Troubleshooting commands
Commands related to debugging start with litespeed-debug.
Sending a report
Sends a report to LiteSpeed about the state of the web environment.
Command: litespeed-debug send
Parameter: /
# Example
wp litespeed-debug send
Do you want to take advantage of the lightning speed and all the other benefits of LiteSpeed web server?
Check out our lightning-fast packages based on the LiteSpeed environment and try out the hosting package of your choice. We’re sure you’ll be amazed by the blazing speed!


COMMENT THE POST
Your comment has been successfully submitted
The comment will be visible on the page when our moderators approve it.