Overview of WooCommerce CLI can be found here and examples here.
Delete shop order by ID, need to add user id that has permissions to delete orders.
wp wc shop_order delete <id> --user=1
Delete orders where date is older than…
for id in $(wp db query "SELECT id FROM wp_posts WHERE post_date < '2021-01-01' AND post_type='shop_order'" --skip-column-names); do wp wc shop_order delete $id --user=1 --force=1; done
Thanks so much for this. I spent ages today trying to wrangle a solution to delete orders older than {date} using Bash today all to no avail. Your script did exactly what I was after.