Plesk for Linux kb: how-to ext: wptk
- Plesk for Linux
How to integrate WP-CLI in Plesk?
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]
# 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.
The link to the documentation is broken, maybe it should be this:
@Maghreb Services SARL
Thank you for noticing! I have changed the link accordingly.
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
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?
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.
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...
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?
HI Ivan, your 'here' link is broken.
Thank you @Sharul, it's fixed.
Helo, is there a way to use wp-cli without installing the WordPress Toolkit Ext?
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/
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?
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.
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.
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).
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.
Please sign in to leave a comment.