WP-CLI is the official WordPress command-line interface for managing WordPress sites. More information can be found here .
You can access WP-CLI directly from the Plesk command-line interface with no need to install WP-CLI on the server.
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 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 main WordPress information (a blog name, a web site 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
: To make the changes performed by running a WP-CLI command visible in the Plesk user interface, go to WordPress, click the name of the WordPress installation, and then click Refresh.