WP-CLI is the official WordPress command-line interface for managing WordPress websites.
See more information about WP-CLI.
You can access WP-CLI directly from the Plesk command-line interface
using the wp-toolkit
utility with no need to install WP-CLI on the
server.
Read more about the wp-toolkit
utility.
To call a WP-CLI command via the Plesk command-line interface:
Connect to your Plesk server via SSH (on Linux) or via RDP (on Windows)
and, in the command line, run the command:
plesk ext wp-toolkit --wp-cli -instance-id [ID] [command] [options]
where:
-
[ID]
is the ID of the WordPress installation in Plesk. To learn
the ID, go to WordPress and click the name of the WordPress
installation. The ID will be displayed at the end of the URL in the
browser. For example, if the URL ends with/id/2
, then the ID=2. -
[command]
is a WP-CLI command prefixed by--
(for
example,-- core
). -
[options]
is the list of the WP-CLI command’s options.
The full list of WP-CLI commands and their options can be found
here .
Examples:
To get the main WordPress information (a blog name, a website URL, a
version, an update version, plugins, and themes):
plesk ext wp-toolkit --wp-cli -instance-id 4 -- core info
To get help for the core
command:
plesk ext wp-toolkit --wp-cli -instance-id 4 -- help core
To install and activate the latest version of the bbPress plugin
from wordpress.org:
plesk ext wp-toolkit --wp-cli -instance-id 4 -- plugin install bbpress --activate
Note: To make the changes performed by running a WP-CLI command visible in
WP Toolkit, refresh the corresponding WordPress installation.
To do so, go to WordPress and then click the icon
on the installation card.