Question
How to manage WordPress plugins via command line?
Answer
- Login to the server via SSH;
- Find instance id, in below case it's 2 and 11:
# plesk ext wp-toolkit --list
ID Main Domain ID Main Domain's Path Owner ID Alive Site URL Name Version
2 1 /httpdocs/wordpress 1 true https://example2.com/wordpress My CMS 4.9.5
11 26 /httpdocs 1 true https://example.com My CMS 4.9.5 -
Find installed plugins, for example for instance 11 (example.com):
# plesk ext wp-toolkit --wp-cli -instance-id 11 -- plugin list
+-------------------------+----------+--------+---------+
| name | status | update | version |
+-------------------------+----------+--------+---------+
| akismet | inactive | none | 4.0.3 |
| autoptimize | active | none | 2.3.4 |
| hello | inactive | none | 1.7 |
| hummingbird | active | none | 1.8.0.4 |
+-------------------------+----------+--------+---------+- To deactivate plugin use command:
# plesk ext wp-toolkit --wp-cli -instance-id 11 -- plugin deactivate plugin_name
-
To active plugin use command:
# plesk ext wp-toolkit --wp-cli -instance-id 11 -- plugin activate plugin_name
-
To activate all plugins:
# plesk ext wp-toolkit --wp-cli -instance-id 11 -- plugin activate --all
-
To update plugin:
-
# plesk ext wp-toolkit --wp-cli -instance-id 11 -- plugin update plugin_name
-
To install and activate plugin:
# plesk ext wp-toolkit --wp-cli -instance-id 11 -- plugin install plugin_name --activate
-
To remove plugin:
# plesk ext wp-toolkit --wp-cli -instance-id 11 -- plugin delete plugin_name
- To deactivate plugin use command:
For more information:
# plesk ext wp-toolkit --help
# plesk ext wp-toolkit --wp-cli -instance-id 11 -- plugin --help
# plesk ext wp-toolkit --wp-cli -instance-id 11 -- plugin activate --help