Skip to content

Instantly share code, notes, and snippets.

@ezequiel9
Last active August 15, 2019 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ezequiel9/e9aea90871349fa5aaa6d75c7e0df060 to your computer and use it in GitHub Desktop.
Save ezequiel9/e9aea90871349fa5aaa6d75c7e0df060 to your computer and use it in GitHub Desktop.
How to install WP-CLI in Windows 10.

WP-CLI is a tool for controlling WordPress through a console window.

1. Install Composer if you don't have it globally.

Go to this link and follow the instructions. https://getcomposer.org/doc/00-intro.md#installation-windows (this is not a guide to install composer :))

C:\Users\username>composer -V

Composer version xxxxxxxxxx

2. Install PHP if you dont have it globally.

(this is not a guide to install PHP :))

3. Then install WP CLI (asumming you already have curl installed as well)

Open the terminal and download its installer:

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

Check we have it in the current folder:

php wp-cli.phar --info

4. Install it

C:\Users\username>echo @php "%~wp-cli.phar" %*

5. Set environment variable

Go to System’s Properties -> Advanced System Properties -> select the tab labeled Advanced. -> Click Environment Variables, under the System variables section scroll down to the variable named Path and add ;C:\wp-cli

6. Close the terminal and open again. Test it

C:\Users\username> wp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment