Here are a few useful one-liners that you can use to quickly remove all WooCommerce products from your store.
wp post delete $(wp post list --post_status=trash --post_type='product' --format=ids --posts_per_page=10000) --force
wp post list --field=ID --post_type=product --posts_per_page=10000 | xargs wp post delete --force
If you are considering deleting items in WooCommerce, please be aware that this action cannot be undone. Once you have deleted an item, it will be permanently gone from your store. Before taking this action, please be absolutely sure that you no longer need or want the item in question.
I played a bit using the WPCLI commands and tried to determine the fastest way to remove all WooCOmmerce products, and besides SQL WP-CLI is the way to go.
Was this post helpful?
Let me know if you liked the post. That’s the only way I can improve. 🙂