Skip to content

Instantly share code, notes, and snippets.

@TimBHowe
Created August 15, 2024 15:38
Show Gist options
  • Save TimBHowe/eacfbf13e107df69c4713b7b5f7e625e to your computer and use it in GitHub Desktop.
Save TimBHowe/eacfbf13e107df69c4713b7b5f7e625e to your computer and use it in GitHub Desktop.
Run WP WC CLI command to delete all coupons.
all_coupons=($(wp wc shop_coupon list --user=1 --field=id))
for i in $all_coupons; do
wp wc shop_coupon delete $i --user=1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment