How to Install and Use WP-CLI to Manage WordPress Websites

What is WP-CLI?

WP-CLI is a command line interface for WordPress. The project’s goal is to offer a complete alternative to the WordPress admin; for any action you might want to perform in the WordPress admin, there should be an equivalent WP-CLI command.

First, download wp-cli.phar using curl.

Then, check if it works:

To be able to type just wp, instead of php wp-cli.phar, you need to make the file executable and move it to somewhere in your PATH. For example:

Now try running wp --info. If WP-CLI is installed successfully, you’ll see output like this:

Quick Start

Congratulations! You’ve installed WP-CLI for the first time, and are ready to level-up your use of WordPress. This page contains a brief introduction to WP-CLI with some example usage. You can install a plugin from the WordPress admin, you can also install a plugin with WP-CLI:

More WP-CLI commands for practice

1. Download the latest version of WordPress with wp core download

2. Create a new wp-config.php file with wp config create

3. Create the database based on wp-config.php with wp db create

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.