Skip to content

WordPress CLI

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.

Warning

These commands are new for v3. All previous commands have been deprecated. Please update your scripts accordingly.

Option Commands

Commands having to do with options all begin with litespeed-option.

Set a Particular Option

  • Command: litespeed-option set
  • Parameters:
  • <key>: the option key to update
  • value>: the value to assign to the option
wp litespeed-option set <key> <value>

Example

wp litespeed-option set cache-priv false

Example

wp litespeed-option set 'cdn-mapping[url][0]' https://cdn.EXAMPLE.com

What if <value> contains multiple lines? The CLI doesn't accept multi-line input, so you would need to use a different syntax, like this:

wp litespeed-option set <key> $'<value1>\n<value2>'

Example

To set media-lqip_exc to a list of three images like this:

img1.jpg
img2.jpg
img3.jpg
Use the following command:
wp litespeed-option set media-lqip_exc $'img1.jpg\nimg2.jpg\nimg3.jpg'`

Get a Particular Option

  • Command: litespeed-option get
  • Parameters:
  • <key>: the option key to return the value of
wp litespeed-option get <key>

Example

wp litespeed-option get cache-priv

Example

wp litespeed-option get 'cdn-mapping[url][0]'

Get All Options

Displays a list of all options and their values.

  • Command: litespeed-option all
  • Parameters: none
wp litespeed-option all

Export Options

All options are exported to CURRENTDIR/lscache_wp_options_DATE-TIME.txt unless a new path is specified.

  • Command: litespeed-option export
  • Parameters:
  • [--filename=<path>]: optional different path to save export file
wp litespeed-option export `[--filename=<path>]`

Example

wp litespeed-option export --filename=/tmp/export

Import Options

Import options from specified file. Options must be one per line and formatted as option_key=option_value. A semicolon (;) at the beginning of a line indicates a comment. Comment lines are ignored.

  • Command: litespeed-option import
  • Parameters:
  • <file>: options file to import
wp litespeed-option import <file>

Example

wp litespeed-option import options.txt

Reset Options

Resets all options to factory default.

  • Command: litespeed-option reset
  • Parameters: none
wp litespeed-option reset

Purge Commands

LiteSpeed Cache Purge Interface commands begin with litespeed-purge.

Network List

Lists all site domains and IDs on the network.

  • Command: litespeed-purge network_list
  • Parameters: none
wp litespeed-purge network_list

Purge Network

Purges all cache entries for every site in the network. Also works for non-networked sites, just purges that single site.

  • Command: litespeed-purge all
  • Parameters: none
wp litespeed-purge all

Purge Blog

Purges all cache entries for a particular site in the network.

  • Command: litespeed-purge blog
  • Parameters:
  • <blogid>: ID of the site to purge
wp litespeed-purge blog <blogid>

Example

wp litespeed-purge blog 2

Purge Category

Purges all cache entries for a list of categories.

  • Command: litespeed-purge category
  • Parameters:
  • <ids>: IDs of the categories to purge, separated by a space
wp litespeed-purge category <ids>

Example

wp litespeed-purge category 1 3 5

Purge Tag

Purges all cache entries for a list of tags.

  • Command: litespeed-purge tag
  • Parameters:
  • <ids>: IDs of the tags to purge, separated by a space
wp litespeed-purge tag <ids>

Example

wp litespeed-purge tag 1 3 5

Purge Post

Purges all cache entries for a list of post IDs.

  • Command: litespeed-purge post_id
  • Parameters:
  • <ids>: IDs of the posts to purge, separated by a space
wp litespeed-purge post_id <ids>

Example

wp litespeed-purge post_id 1 3 5

Image Optimization Commands

LiteSpeed Image Optimization commands begin with litespeed-image.

Push Images

Sends an image optimization request to the QUIC.cloud server.

  • Command: litespeed-image push
  • Parameters: none
wp litespeed-image push

Pull Images

Pulls optimized images from the QUIC.cloud server.

  • Command: litespeed-image pull
  • Parameters: none
wp litespeed-image pull

Get Status

Shows optimization status based on local data.

  • Command: litespeed-image status or litespeed-image s
  • Parameters: none
wp litespeed-image status

Clean Up

Cleans up unfinished image data on the QUIC.cloud server.

  • Command: litespeed-image clean
  • Parameters: none
wp litespeed-image clean

Remove Original Backups

Removes original image backups.

  • Command: litespeed-image rm_bkup
  • Parameters: none
wp litespeed-image rm_bkup

QUIC.cloud Commands

QUIC.cloud Online Services commands begin with litespeed-online.

Generate API Key

Generates an anonymous domain API key for secure communication with QUIC.cloud.

  • Command: litespeed-online init
  • Parameters: none
wp litespeed-online init

Sync Data

Synchronizes QUIC.cloud service usage information..

  • Command: litespeed-online sync
  • Parameters: none
wp litespeed-online sync

List Cloud Services

Lists all QUIC.cloud services.

  • Command: litespeed-online services
  • Parameters: none
wp litespeed-online services

List Nodes in Use

Lists all currently active QUIC.cloud nodes.

  • Command: litespeed-online nodes
  • Parameters: none
wp litespeed-online nodes

Detect Closest Node

The closest active QUIC.cloud node for a particluar service.

  • Command: litespeed-online ping
  • Parameters:
  • <service>: Service you wish to find a node for
wp litespeed-online ping <service>

Example

wp litespeed-online ping img_optm

Debug Commands

LiteSpeed Debug commands begin with litespeed-debug.

Send Report

Sends an Environment Report to LiteSpeed

  • Command: litespeed-debug send
  • Parameters: none
wp litespeed-debug send

Last update: October 4, 2022