Plesk for Linux
kb: how-to
ext: wptk
Applicable to:
- Plesk for Linux
Question
How to integrate WP-CLI in Plesk?
Answer
WordPress Toolkit in Plesk provides the CLI utility based on WP-CLI. It can be used with the following command:
# plesk ext wp-toolkit --wp-cli -instance-id [ID] -- [command] [options]
For example:
# plesk ext wp-toolkit --wp-cli -instance-id 1 -- plugin list
Instance ID can be obtained using the command below:
# plesk ext wp-toolkit --list
If a WP-CLI command supplied by a plugin does not work, add the option --skip-plugins=false
to the end of the command.
Refer to the Plesk documentation for additional information.
Comments
19 comments
The link to the documentation is broken, maybe it should be this:
https://docs.plesk.com/en-US/onyx/cli-linux/using-command-line-utilities/wptoolkit-wordpress-toolkit.78685/
HI Ivan, your 'here' link is broken.
Hi, I'm trying to get this plugin Index WP MySQL For Speed to work with the WP-CLI.
The description (somewhere on the bottom) recommends using WP-CLI as this will not result in timeouts during execution, which seemed perfect. But this has failed so far.
What I did so far with success:
The command that fails to work however is the following one (instructions also in the plugin description in the URL given above):
OR (I tried using the full plugin name as well)
Both these commands result in the same error:
Why is this? Am I missing something? Does WP-CLI (provided by WP-Toolkit) not support using plugin commands?
Helo, is there a way to use wp-cli without installing the WordPress Toolkit Ext?
Thank you.
Hello @Daniel Pereyra,
You can install wp-cli directly o the server as described in the official WordPress documentation: https://make.wordpress.org/cli/handbook/
Hello Project Aspen,
> not working for me... tried even to install wp-cli.phar
Was there any error displayed?
Have you used commands like described here to install wp-cli.phar?
@Maghreb Services SARL
Thank you for noticing! I have changed the link accordingly.
Hi Support Plesk,
I want to know if Plesk + WP-CLI is working well?
Can Plesk + WP-CLI + SSH be used by customers?
If the customers with SSH rights executes the WP-CLI command, will it affect security, is the data of other customers on the same server separate from each other?
Hello @Michael Klaumann!
As per the above comment, WP-CLI shipped with WP Toolkit may not work with plugins' commands.
As WP-CLI shipped with WP Toolkit is called via the command plesk ext wp-toolkit, it can be used only under the 'root' user (as the plesk utility is available only under the 'root' user).
Just checking on this?
Hello @Albert Jan Grasmeijer!
As I know, plugins add their commands to WP-CLI, so they should be aware of the location of the WP-CLI to do this.
WP-CLI provided by the WP Toolkit is stored in the custom location, so it's most likely the reason for why the plugin commands don't work.
So, you can try using WP-CLI that's manually installed to the website's directory and see whether the plugin commands will work in such case, or contact the plugin developers to know more how to add their plugin's commands to WP-CLI.
Thanks @Taras Ermosin,
My main purpose is to allow users to have access to the WP-CLI so having it only available to the 'root' user is very limiting. Is there a way to make it available to users in a chrooted shell? Seems simple enough. All the major web hosting companies have the WP-CLI available to every user so this is a selling point.
If I install the regular non-Plesk version of WP-CLI can I make that available to the users? More of a Linux question at this point.
Hi @Michael Klaumann!
The plesk utility cannot be added to the chrooted shell.
You can install regular WP-CLI directly to users' chrooted shells manually.
Is it the case with Plesk version 18.0.48 that the Plesk WP-CLI does not have all the features of the full WP-CLI? And that only the root user can use it?
I want to install it so users can have access to the WP-CLI from their individual accounts.
For some reason, WP CLI import command [https://developer.wordpress.org/cli/commands/import/] does not work. It is giving the error WordPress Importer needs to be activated. Try 'wp plugin activate wordpress-importer'.
Is this a feature that hasn't been implemented?
Hello @George Georgopoulos,
The "plesk ext wp-toolkit --wp-cli" utility is not a full replacement of native "wp" utility
It has limited functionality and "import" is not supported Plesk "wp-cli" command
Thank you @Sharul, it's fixed.
Nikita Marinchuk
Hi, I'm trying to regenerate media and I thought the command media was available in WP-CLI...
plesk ext wp-toolkit --wp-cli -instance-id 2 -path /var/www/vhosts/xxx/httpdocs -- media regenerate --yes
not working for me... tried even to install wp-cli.phar
I really need to regenerate thumbnails, if command is not available how do I go about making a complete WP-CLI installation on Plesk? I also would like to use Smush, Media Cleaner and others with WP-CLI...
thanks
@Phi Nguyen
Hi,
I can see that you got an answer to your question in a support ticket.
Anyway, let me answer it here for others: WP-CLI utility can be run only by administrator of the server, in other words by root user.
Please sign in to leave a comment.