Skip to content

Instantly share code, notes, and snippets.

@growdev
Created March 19, 2015 19:01
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save growdev/b68e35b5c6e0856bdbf1 to your computer and use it in GitHub Desktop.
Save growdev/b68e35b5c6e0856bdbf1 to your computer and use it in GitHub Desktop.
Delete all WooCommerce Products with wp-cli
wp post list --field=ID --post_type=product | xargs wp post delete --force
@CallejaMotos
Copy link

hi there!
please, may you help me?
I would like to create and update products through WP WC CLI. I can't success, I just can do it through:
| wp wc product update --name="test2" --user=admin | wp wc product update --name="test3" --user=admin | wp wc product update --name="test4" --user=admin | wp wc product update --name="test5" --user=admin | wp wc product update --name="test6" --user=admin

in command line (terminal)
hope you can give me a hand..
mybest

@lukecav
Copy link

lukecav commented Dec 19, 2019

wp post list --field=ID --post_type=product --posts_per_page=2000 | xargs wp post delete --force

@CallejaMotos
Copy link

wp post list --field=ID --post_type=product --posts_per_page=2000 | xargs wp post delete --force

thanks, I already change to prestashop, anyway thanks for your reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment