I would like to delete auto-generated coupon codes under shopping cart price rules in magento through script. can anyone please help me on this.

1 Answer 1


The coupon codes should be stored in the salerule_coupon database table.

If you don't have access to the database, the easiest way to purge those coupons is to DELETE the Sales Rule. The Database is configured to cascade on delete, and so all of the coupons associated with that rule should be purged as well.

If you need to settings/configurations for that rule, just screenshot and/or write it down before you delete it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.