WP Toolkit Command Line Interface
Valid for versions 110 through the latest version
Version:
110
Last modified: October 4, 2024
Overview
This document lists all of the commands available in your server’s command line interface via the WP Toolkit.
Run the API
To run the API, first connect to your cPanel server via SSH. For information on how to connect via SSH, read our SSH Access documentation. For information on how to connect to the cPanel Terminal interface (cPanel » Home » Advanced » Terminal), read our Terminal for cPanel documentation.
The commands take the following form:
wp-toolkit <command> [options]
Commands
The API accepts the following commands:
Command | Parameter | Description | Example |
---|---|---|---|
--clear-cache |
[option] |
Clears the cache of the selected WordPress installation. Requires the following options: To show output in a particular format, specify the |
To clear the cache of the WordPress installation with the ID
|
--clear-wpt-cache |
Clears the WP Toolkit cache. |
To clear the WP Toolkit cache:
|
|
--register |
[option] |
Adds a WordPress installation to WP Toolkit. Requires the To show output in a particular format, specify the |
To add the WordPress installation on the domain with the ID
|
--info |
[option] |
Displays the detailed information about the selected WordPress installation. Requires the following options: To show output in a particular format, specify the |
To display information about the WordPress installation with the ID
|
--config |
[option] |
Manages WP Toolkit settings. Requires the If If To show output in a particular format, specify the |
To display a list of WP Toolkit settings and their values:
|
--wp-cli |
[option] |
Executes a Requires the |
To display all plugins for the WordPress installation with the ID
|
--list |
Displays a brief description of WordPress installations existing on the server. To specify filters, use the following options: To show output in a particular format, specify the |
To display a brief description of all WordPress installations existing on the server:
|
|
--help or -h
|
Displays help on the use of this utility. |
To view the help info on the use of this utility:
or
|
|
--install |
[option] |
Installs WordPress on a domain. Requires the Can be used with the following options:
To show output in a particular format, specify the |
To install WordPress with the default settings on the domain example.com:
|
--clone |
[option] |
Clones a WordPress website to another domain and/or subdirectory. Requires the Can be used with the following options:
To show output in a particular format, specify the |
To clone the WordPress installation with the ID
|
--copy-data |
[option] |
Copies the content of your WordPress website including files and database to another WordPress website. Requires the Can be used with the following options:
To show output in a particular format, specify the |
To copy the content of the website with the ID
|
--detach |
[option] |
Detaches a WordPress website. Requires the following options: |
To detach the WordPress installation with the ID
|
--languages |
[option] |
Displays the list of languages available for the specified
WordPress version. Requires the To show output in a particular format, specify the |
To display the list of languages available for WordPress version 4.9.8 in the JSON format:
|
--sets |
[option] |
Manages sets of plugins and themes. Requires the To show output in a particular format, specify the |
To display available sets of plugins and themes:
|
--plugins --skip-plugins=false |
[option] |
Manages uploaded plugins. Requires the To use To use To show output in a particular format, specify the |
To display all uploaded plugins:
|
--themes |
[option] |
Manages uploaded themes. Requires the To show output in a particular format, specify the |
To remove the uploaded theme that has the ID
|
--smart-update |
[option] |
Enables and disables Smart Updates for a website. Requires the following options: To show output in a particular format, specify the |
To enable Smart Updates for the WordPress installation with the ID
|
--versions |
Displays available WordPress versions that can be installed via WP Toolkit. To show output in a particular format, specify the |
To display available WordPress versions that can be installed via WP Toolkit:
|
Options
This API accepts the following options:
Command | Parameter | Description | Example |
---|---|---|---|
-instance-id |
<instance_id> |
WordPress installation ID. |
To activate plugin “hello” on the WordPress installation with the ID
|
-main-domain-id |
<main_domain_id> |
Main domain ID. |
To display information about the WordPress installation with the ID
|
-path |
<path> |
The relative path from the domain’s document root directory, for example, /subdirectory . |
To add the WordPress installation on the domain with the ID
|
-plugins |
Adds information about the number of plugins on WordPress
installations when the list command is executed. |
To display main data (including the number of plugins) on all WordPress installations existing on the server:
|
|
-themes |
Adds information about the number of plugins on WordPress
installations when the list command is executed. |
To display main data (including the number of themes) on all WordPress installations existing on the server:
|
|
-format |
raw | json |
Renders output in a particular format. Supported formats: JSON, raw. By default, all data is shown in the raw format. |
To display main data on all WordPress installations existing on the server in the JSON format:
|
-domain-id |
<domain-id> |
The domain ID. |
To install WordPress with the default settings on the domain
with the ID
|
-domain-name |
<domain_name> |
The domain name. |
To install WordPress with the default settings on the domain example.com:
|
-operation |
Necessary for certain commands to specify the corresponding operation. |
To display all uploaded themes:
|
|
-site-title |
<site_title> |
The website title. Used with the --install command. |
To install WordPress with the site title “Example Site” on the
domain with the ID
|
-protocol |
http | https
|
The protocol name. Used with the --install command. |
To install WordPress on the domain with the ID
|
-db-name |
<database_name> |
The database name. Used with the --install command. |
To install WordPress on the domain with the ID
|
-db-user |
<database_user> |
The database user name. Used with the To specify the database user password, use the |
To install WordPress on the domain with the ID
|
-table-prefix |
<table_prefix> |
The table prefix. Used with the --install command. |
To install WordPress on the domain with the ID
|
-db-server |
IP address of the remote database server | localhost:3306
|
The database server. Used with the --install command. |
To install WordPress on the domain with the ID
|
-language |
<locale_name> |
The WordPress language. Used with the --install command. |
To install WordPress on the domain with the ID
|
-version |
<version> |
The WordPress version. Used with the --install command. |
To install WordPress version 4.9.8 on the domain with the ID
|
-admin-email |
<admin-email> |
The email of the WordPress administrator. Used with the
--install command. |
To install WordPress on the domain with the ID
|
-username |
<username> |
Specifies the administrator username. Used with the To specify the administrator password, use the |
To install WordPress on the domain
|
-set-id |
<set_id> |
The ID of a set for installing or removing plugins and themes. |
To add the plugin with the ID
|
-source-url |
<source_url> |
The source URL, by which a plugin or a theme is available (used to upload plugins and themes). |
To upload a plugin available by the known URL:
|
-plugin-id |
<plugin_id> |
The ID of an uploaded plugin. Used with the --sets command and the add-plugin and
remove-plugin operations. |
To add the uploaded plugin with the ID
|
-theme-id |
<theme_id> |
The ID of an uploaded theme. Used with the --sets command and the add-theme and
remove-theme operations. |
To add the uploaded theme with the ID
|
-plugin-slug |
<plugin_slug> |
The plugin slug for adding or removing plugins found in the
wordpress.org repository. Used with the --sets command and the add-plugin and
remove-plugin operations. |
To remove the plugin with the slug “akismet” from the set with
the ID
|
-theme-slug |
<theme_slug> |
The theme slug for adding or removing themes found in the
wordpress.org repository. Used with the -sets command and the add-theme and
remove-theme operations. |
To add the theme with the slug “breviter” to the set with the ID 1:
|
-source-instance-id |
<source-instance-id> |
The source WordPress website ID. Used with the --clone and --copy-data commands. |
To clone the WordPress installation with the ID
|
-target-domain-name |
<target-domain-name> |
The target domain name. Used with the --clone command. |
To clone the WordPress installation with the ID
|
-target-domain-id |
<target-domain-id> |
The target domain ID. Used with the --clone command. |
To clone the WordPress installation with the ID
|
-target-path |
<target-path> |
The path inside the target domain’s document root. Used with the If the option is not specified, a WordPress website is cloned to the domain root directory. |
To clone the WordPress installation with the ID
|
-target-db-name |
<target-db-name> |
The target database name (generated automatically if not specified). Used with the --clone command. |
To clone the WordPress installation with the ID
|
-target-db-user-login |
<target-db-user-login> |
The username of the target database user (generated automatically if not specified). Used with the To specify a password for the database user, use the |
To clone the WordPress installation with the ID
|
-target-db-server-id |
<target-db-server-id> |
The ID of the target MySQL database server. Used with the If the option is not specified, the default database server is used on the target domain. |
To clone the WordPress installation with the ID
|
-force-overwrite |
yes | no
|
Used with the --clone command. If the option is set to “yes”, WP Toolkit overwrites data on the target domain and path ignoring any existing WordPress installations and other potential website data.
The default state of the option is “no”. |
To clone the WordPress installation with the ID
|
-show-progress |
yes | no
|
Manages if the progress of an operation is shown or not. By default, the option is set to `yes` and the progress is displayed (unless you specify the JSON output format). If set to `no`, the operation is performed silently. |
To clone the WordPress installation with the ID
|
-option-name |
<option-name> |
The WP Toolkit setting name. The option is used with the --config command and the -operation option. |
To see the value of the
|
-option-value |
<option-value> |
The WP Toolkit setting value. The option is used with the --config command and the -operation option that has the set argument. |
To set the
|
-target-instance-id |
<target-instance-id> |
The target WordPress website ID. Used with the --copy-data command. |
To copy the content of the website with the ID
|
-data-to-copy |
all | files | db
|
Used with the --copy-data command. Specifies what data to copy: files and database, files only, or database only. |
To copy the content of the website (files only) with the ID
|
-files-replace-modified |
yes | no
|
Used with the --copy-data command. Set to “yes” by default.
When set to “yes”, it replaces files modified on the target with files from the source even if the source files are older. |
To copy the content of the website with the ID
|
-files-remove-missing |
yes | no
|
Used with the --copy-data command.
When set to “yes”, it removes files existing on the target but absent from the source. |
To copy the content of the website with the ID
|
-db-tables-copy-mode |
default | all | new | selected
|
Used with the
|
To copy the content of the website with the ID
|
-db-tables |
A comma-separated list of database tables. |
Used with the Specifies which database tables to copy. |
To copy the content of the website with the ID
|
-exclude-db-tables |
A comma-separated list of database tables. |
Used with the Specifies which database tables to exclude from copying. |
To copy the content of the website with the ID
|
-create-restore-point |
yes | no
|
Used with the When set to “yes”, it creates a restore point you can later use to revert the changes made during copying if something goes wrong. |
To copy the content of the website with the ID
|
-username |
<username> |
Used with the To specify the administrator password, use the |
To install WordPress on the domain
|
-auto-updates |
true | false | minor
|
Configures automatic WordPress updates. Set to minor (security) updates by default. Used with the |
To install WordPress on the domain
|
-plugins-auto-updates |
true | false
|
Turns on and off automatic updates of WordPress plugins. Set to false by default. Used with the |
To install WordPress on the domain
|
-themes-auto-updates |
true | false
|
Turns on and off automatic updates of WordPress themes. Set to false by default. Used with the |
To install WordPress on the domain
|
WP-CLI commands
WP Toolkit proxies some commands to WP-CLI
. This allows you to configure WordPress sites using global parameters.
You may need to add --skip-plugins=false
and --skip-themes=false
to WP-CLI
plugin and theme commands for them to resolve.
For more information about WP-CLI
commands, including parameters and options, read the WP-CLI
Config documentation.
You can include a WP-CLI
command in a WP Toolkit command if you separate it with a double hyphen, as follows:
wp-toolkit --wp-cli -instance-id 1 -- plugins list --skip-plugins=false