Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install and manage WordPress with WP-CLI

This guide introduces WP-CLI, a text tool that installs and manages WordPress without clicking through the dashboard.

WordPress2 min read7 steps4 screenshots

What is WP-CLI?

CLI means command line interface. It is a window where you type short commands instead of clicking buttons. WP-CLI is a free tool made for WordPress. One command can update every plugin. It is faster than clicking each one.

You need SSH access to use it. SSH is a safe way to type commands on your server from afar. Ask Hostvento support whether your plan offers SSH and whether WP-CLI is installed. On a VPS or dedicated server you have root access and can install it yourself.

Check if WP-CLI is installed

wp --info

This shows the WP-CLI version. If you see "command not found", install it below.

Install WP-CLI

  1. Download the tool.
    curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
    This saves the program file.
  2. Make it runnable.
    chmod +x wp-cli.phar
  3. Move it to a folder where commands live.
    sudo mv wp-cli.phar /usr/local/bin/wp
    This needs root access. Without root, keep the file in your home folder and run it as php wp-cli.phar.
    Screenshot: Move it to a folder where commands live. sudo mv wp-cli.phar /usr/local/bin/wp This needs

Install a new WordPress site

  1. Go to your site folder.
    cd /path/to/your/site
    Screenshot: Go to your site folder. cd /path/to/your/site
  2. Download WordPress.
    wp core download
    Screenshot: Download WordPress. wp core download
  3. Create the config file. Use your own database details.
    wp config create --dbname=wpdb --dbuser=wpuser --dbpass=YourPassword --dbhost=localhost
    This writes wp-config.php for you.
  4. Run the install.
    wp core install --url=https://example.com --title="My Site" --admin_user=siteowner --admin_password=StrongPassHere --admin_email=you@example.com
    This sets up the site and your first user.

Everyday commands

CommandWhat it does
wp core updateUpdates WordPress
wp plugin listLists your plugins
wp plugin update --allUpdates all plugins
wp theme listLists your themes
wp user listLists users
wp cache flushClears the object cache
Warning: Take a backup before you run bulk update commands.

Quick recap

  • WP-CLI lets you run WordPress tasks by typing commands.
    Screenshot: WP-CLI lets you run WordPress tasks by typing commands.
  • Use wp --info to check if it is installed.
  • Download, configure and install a site in four commands.
  • Use it to update and manage plugins, themes and users quickly.