WP-CLI is the WordPress Command line tool. WP CLI helps the user like us to perform WordPress administration tasks and Scaffolding. For more detail of the WP CLI, Please go to the WP CLI handbook.
In this article, I will show how to install the WP CLI in Windows.
- Open the
D:
drive in the “My PC” explorer. - Make a new folder
wp-cli
in theD:/
drive - Now download the wp-cli.phar from the
https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
- Move the downloaded wp-cli.phar to the
D:/
wp-cli folder. - Create a file named
wp.bat
in
with the following contents:D:\
wp-cli\wp
@ECHO OFF
php "d:/wp-cli/wp-cli.phar" %*
- Then we should set the
D:/wp-cli
for the path by running following command by the command line. Please note that I have usedd:\
in the lower case
setx path "%path%;d:\wp-cli"
- Then run the wp command from anywhere and see the output.