woocommerce/docs/wc-cli/using-wc-cli.md

1.2 KiB

post_title menu_title tags
How to Use WooCommerce CLI Using WooCommerce CLI how-to

Introduction

This guide aims to assist beginners in using WooCommerce CLI (WC-CLI) for managing WooCommerce stores via the command line.

Getting Started

  • Ensure WP-CLI is installed and WooCommerce is at least version 3.0.0.
  • To check 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 Tasks

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, check out our WC-CLI commands documentation