How to Delete expired coupons automatically in Woocommerce

By | August 20, 2018

Coupons are a great way to offer discounts and rewards to your customers, and can help promote sales across your shop but problem is that coupons have some expire time. After some specific time, coupons are expire and by default WooCommerce will not delete them. So How to Delete expired coupons automatically in Woocommerce? So here is solution. Let’s have a look.

So here is my code. Just copy this code and paste this code at the end of your theme’s functions.php file of your active child theme (or theme) and Save the file.

Using this code, all expired coupons move to Trash folder, You can see it on Dashboard->WooCommerce->Coupons. so you can delete permanently as you wish.

If you want to permanently delete the coupons directly instead of trashing them, you can change this code:

Replace upper line of code by below line of code.

So Your expired coupons permanently deleted and it cannot be recovered.