Spectial Offer. We are offering a 15% discount on this London Dedicated Server. Use this Coupon Code 4BMS2SU5OB Buy Now

 Spectial Offer. We are offering a 15% discount on this London Dedicated Server. Use this Coupon Code 4BMS2SU5OB Buy Now

 Spectial Offer. We are offering a 15% discount on this London Dedicated Server. Use this Coupon Code 4BMS2SU5OB Buy Now

 Spectial Offer. We are offering a 15% discount on this London Dedicated Server. Use this Coupon Code 4BMS2SU5OB Buy Now

 Spectial Offer. We are offering a 15% discount on this London Dedicated Server. Use this Coupon Code 4BMS2SU5OB Buy Now

 Spectial Offer. We are offering a 15% discount on this London Dedicated Server. Use this Coupon Code 4BMS2SU5OB Buy Now

 Spectial Offer. We are offering a 15% discount on this London Dedicated Server. Use this Coupon Code 4BMS2SU5OB Buy Now

 Spectial Offer. We are offering a 15% discount on this London Dedicated Server. Use this Coupon Code 4BMS2SU5OB Buy Now

 Spectial Offer. We are offering a 15% discount on this London Dedicated Server. Use this Coupon Code 4BMS2SU5OB Buy Now

 Spectial Offer. We are offering a 15% discount on this London Dedicated Server. Use this Coupon Code 4BMS2SU5OB Buy Now

How to Install and Use WP-CLI on Your Server – A Complete Guide by Colobird

WP-CLI is a powerful command-line tool that allows you to manage WordPress installations efficiently. Whether you're installing plugins, updating themes, or managing users, WP-CLI speeds up your workflow and is ideal for system administrators, developers, and agencies managing multiple WordPress sites.

In this tutorial from Colobird, we’ll walk you through how to install WP-CLI globally on a server and demonstrate some of the most useful commands.

Why Use WP-CLI?

  • Automate repetitive tasks.

  • Perform updates without logging into the WordPress dashboard.

  • Manage plugins, themes, users, and more via terminal.

  • Save time on large-scale WordPress maintenance.

Pre-requisites

Before you begin, ensure your server environment meets the following requirements:

  • A UNIX-like operating system (Linux, macOS, FreeBSD, etc.)

  • PHP version 5.4 or higher

  • WordPress 3.7 or newer installed

Install and Use WP-CLI on Your Server

To install WP-CLI globally on your server, follow these steps:

  • Installing WP-CLI (Globally for All Users)

    1. Download WP-CLI using curl or wget:

    curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

    2. Check that WP-CLI works:

    php wp-cli.phar --info

    3. Make the file executable and move it to a global location:

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

    4. Verify the installation:

    wp --info

    If everything is set up correctly, you’ll see details about your server environment and WP-CLI version.

  • Updating WP-CLI

    To update WP-CLI to the latest version, run:

    wp cli update

    Or repeat the installation steps with the latest .phar file.

  • Using WP-CLI as a Site User

    To test WP-CLI from a specific user account (e.g., your WordPress site user):

    su - wordpress
    wp --version

    Replace wordpress with the actual system username.

  • Managing Plugins with WP-CLI

    List all installed plugins:

    wp plugin list

    Activate a plugin:

    wp plugin activate plugin-name

    Deactivate a plugin:

    wp plugin deactivate plugin-name

    Delete a plugin:

    wp plugin delete plugin-name

    Update all plugins:

    wp plugin update --all

    Update a single plugin:

    wp plugin update plugin-name

  • Managing Themes with WP-CLI

    List all themes:

    wp theme list

    Install a theme:

    wp theme install theme-name

    Activate a theme:

    wp theme activate theme-name

    Update all themes:

    wp theme update --all

  • Upgrade or Downgrade WordPress Core

    Check current WordPress version:

    wp core version

    Update to the latest WordPress version:

    wp core update

    Downgrade WordPress to a specific version (use with caution):

    wp core update --version=6.2.2 --force

  • Managing WordPress Users

    List all users:

    wp user list

    Create a new administrator:

    wp user create newusername email@example.com --role=administrator --user_pass=StrongPassword123!

    Update a user’s password:

    wp user update username --user_pass=NewSecurePassword

    Delete a user:

    wp user delete username

    Delete a user and reassign their content to another user:

    wp user delete olduser --reassign=newuser

Additional Resources

  • Official WP-CLI Handbook

  • WP-CLI Commands

  • WP-CLI Community Commands

Conclusion

WP-CLI is an essential tool for any WordPress server administrator or developer. With it, you can streamline your workflows, automate tasks, and manage WordPress efficiently — all from the command line.

Need help setting up WP-CLI on your Colobird-hosted server? Contact our support team, we're here to help!