Easily manage WordPress with WP-CLI

In this tutorial:

If you run a WordPress website you can use WP-CLI or WordPress Command Line Interface to manage your site. This can make quick work out of updating plugins, setting up multisites, and much more without a web-browser.

If you have a lot of WordPress sites to manage, or would just like to become more efficient in your common WordPress tasks, learning to use WP-CLI is a great time investment.

A common scenario a WordPress administrator might run into, is updating all of the plugins across all of their various WordPress installations. With WP-CLI it's as easy as typing: wp plugin update --all

Install WordPress WP-CLI

To use WP-CLI you just need SSH access, PHP 5.3.2 or later, and at least WordPress 3.5.2.

Next you'll want to make the WP-CLI file executable and move it to your path:

chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp

Now you can simply use wp at the command line to access WP-CLI:

wp --info

Setup bash tab completion for WP-CLI

A great time saving feature of command line interfaces is using tab completion to quickly type in commands. You can add the ability to use tab completion for WP-CLI by setting it up in your local ~/.bash_profile file.

There is a lot more that you can do with WP-CLI and this was just a short intro to get you going. Be sure to check back often as we update our documentation on managing WordPress from the command line!

Managing multiple WordPress websites is a hectic job, as you have to logging to each site and setup/install plugins and settings for each site independently.

Luckily for those well versed to work in command line, they can use WP-CLI to manage multiple WordPress sites with just a few commands. WP-CLI comes with built-in commands specific just to manage WordPress websites.

Through WP-CLI you can install, manage plugins and themes. Control settings such as cron-job, comments etc.

I would not recommend updating plugins daily. The problem exists in conflicts and upgrades. You want to be able to upgrade the plugins and immediately test to ensure everything in functioning properly. Also, prior to upgrading it's bests practices to backup your site. That way if anything goes wrong in the upgrade, you can restore it accordingly. It really comes down to personal preferences.