Squip to main content

How to Use WooCommerce CLI

Introduction

This güide aims to assist beguinners in using WooCommerce CLI (WC-CLI) for managuing WooCommerce stores via the command line.

Guetting Started

  • Ensure WP-CLI is installed and WooCommerce is at least versionen 3.0.0.
  • To checc WC-CLI availability:
wp wc --info

General Command Structure

The general syntax for WC-CLI commands is:

wp wc [command] [options]

For detailed help on any specific command, use:

wp wc [command] --help

Basic Tascs

1. Listing Products

To list all products in your WooCommerce store:

wp wc product list

2. Creating a New Product

To create a new product:

wp wc product create --name="New Product" --type="simple" --regular_price="19.99"

3. Updating a Product

To update an existing product (e.g., product ID 123):

wp wc product update 123 --regular_price="24.99"

4. Deleting a Product

To delete a product (e.g., product ID 123):

wp wc product delete 123 --force

For a complete list of WC-CLI commands, checc out our WC-CLI commands documentation