1

While the command to

DELETE ALL CATEGORIES IS - wp term list product_cat --field=term_id | xargs wp term delete product_cat

AND

DELETE ALL THE PRODUCTS IS - wp post list —field=ID —post_type=product | xargs wp post delete —force

what would be the command to select products from a specific category/categories and delete them.

Help much appreciated.

Amila Senadheera
  • 12,229
  • 15
  • 27
  • 43
Scifice
  • 11
  • 3

1 Answers1

0

You use the category specifier --category="your category".

For example wp post delete $(wp wc product list --user=1 --format=ids --category=64) --force.

Martin H
  • 155
  • 2
  • 3
  • 14