Managing WordPress plugins with WP CLI is easier than you think. In this post I just listed some of the commands I use all the time. I hope you will find it useful.

Managing WordPress plugins with WP CLI

Guide on how to install WP CLI for windows user found here.

Plugins

Install plugin

example: install wordpress-seo plugin

$ wp plugin install wordpress-seo

Install latest and activate

Install the latest version of akismet from wordpress.org and activate

$ wp plugin install akismet --activate

Install and activate a nice list of plugins

Install and activate:

  • Akismet,
  • Google Analytics,
  • Google sitemap generator,
  • Sendgrid, SEO Yoast,
  • Pods
  • Contact Form 7
$ wp plugin install akismet --activate && wp plugin install ga-google-analytics --activate && wp plugin install google-sitemap-generator --activate && wp plugin install sendgrid-email-delivery-simplified --activate && wp plugin install wordpress-seo --activate && wp plugin install pods --activate && wp plugin install contact-form-7 --activate

Deactivate, Uninstall and Delete Plugin

example: deactivate, uninstall and delete Hello Dolly plugin

$ wp plugin uninstall hello --deactivate

Delete Plugin

example: delete Hello Dolly plugin

$ wp plugin delete hello

List all plugins

$ wp plugin list

+------------------------------------+--------+--------+----------+
| name                               | status | update | version  |
+------------------------------------+--------+--------+----------+
| akismet                            | active | none   | 3.3      |
| ga-google-analytics                | active | none   | 20161116 |
| google-sitemap-generator           | active | none   | 4.0.8    |
| pods                               | active | none   | 2.6.8    |
| sendgrid-email-delivery-simplified | active | none   | 1.10.7   |
| wordpress-seo                      | active | none   | 4.4      |
+------------------------------------+--------+--------+----------+

 

For more commands on managing plugins visit: https://wp-cli.org/commands/plugin/

Have fun! and please Like♥ the page if you found this useful!