Install WP-CLI on Windows – WordPress Command-Line Interface Quick tutorial explaining how to install the WordPress Command-Line Interface (WP-CLI) on Windows using composer or a wp-cli.phar and a batch file

10 Must-Have features for a WordPress Website in 2019

As you most likely already know, WP-CLI is the official command line tool for interacting with and managing your WordPress sites. It can be used for a number of different reasons, from installing and updating the WordPress core, to managing plugins and themes, and so on. In this brief tutorial we’ll explain how to install the WP-CLI on Windows using two methods: composer or a phar+bat files combo.

Install using Composer

To install the WP-CLI using composer, we strongly suggest to read this official guide from make.wordpress.org.

Install using PHAR+BAT files

To install WP-CLI using a plain batch file, follow these steps:

  1. Make sure you have php installed and in your path so you can execute it globally.
  2. Download wp-cli.phar manually from here and save it to a folder, such as c:\wp-cli
  3. Create a file named wp.bat in c:\wp-cli with the following contents:

The last thing you need to do is to add c:\wp-cli to your path. You can either do that from the Command Panel (System > Advanced) or by executing the following CMD:

You can now use WP-CLI from anywhere in Windows command line.

 

About Ryan

IT Project Manager, Web Interface Architect and Lead Developer for many high-traffic web sites & services hosted in Italy and Europe. Since 2010 it's also a lead designer for many App and games for Android, iOS and Windows Phone mobile devices for a number of italian companies. Microsoft MVP for Development Technologies since 2018.

View all posts by Ryan

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.