Table of Contents
Was this article helpful?
Try Vultr Today with

$50 Free on Us!

Want to contribute?

You could earn up to $600 by adding new articles.

Using WP-CLI to Manage WordPress on Ubuntu

Last Updated: Wed, Sep 23, 2015
Server Apps Ubuntu

WP-CLI is a tool that allows you to manage WordPress installations on your server from the command line. It can be very handy for efficient management of multiple WordPress installations. This guide assumes that you have already installed WordPress on a LAMP stack.

WP-CLI comes pre-installed on the Vultr One-Click WordPress app.

Step 1: Installing WP-CLI

Before we can actually use WP-CLI to manage WordPress, we need to install it:

cd ~

curl -k -L > wp-cli.phar

Test it:

php wp-cli.phar --info

This will display PHP information.

Step 2: Modifying ~/.bashrc

In order for the wp command to work, we need to alter our ~/.bashrc file. Open it, and add the following line:

alias wp="php /home/USERNAME/wp-cli.phar"

Now reload the file:

source ~/.bashrc

Step 3: Using WP-CLI

In order to use WP-CLI, navigate to the folder that contains your WordPress installation. You can now use WP-CLI commands in that folder. For example, try updating your WordPress installation with the following command:

wp core update

For a full list of WP-CLI commands, see the documentation on the official site.

Want to contribute?

You could earn up to $600 by adding new articles.