A coupon that outlived its own limit
The end date passed or the usage limit ran out, and the coupon is still published. Customers find the code, try it, and abandon the cart at the last step.
The symptom
A code from last year’s campaign is still listed under Marketing → Coupons, still published, and still out there: in an old newsletter, on a coupon site, in an affiliate’s post that nobody took down. The customer types it at checkout and gets Coupon “SPRING20” has expired. A coupon whose usage limit ran out does the same, with Usage limit for coupon “SPRING20” has been reached.
Nothing in the admin warns you. The coupon list still shows it as published; to spot it, you would have to compare the Usage / Limit and Expiry date columns with today yourself. And nothing counts the customers who were turned away.
What it costs
A dead code costs you sales at the most expensive moment. The customer has chosen, added to the cart and reached checkout. A rejected code there does not send them back to your store. It sends them to search for a code that works, on somebody else’s site.
There is no way to put a number on it, because nobody records how many customers tried the code. That is why Merchlint shows no amount for this check. The usage count is the next best thing: a coupon used dozens of times was really circulating, while one used zero times was probably never sent out.
How to check it yourself
Coupons are a post type, and their settings are ordinary post meta:
wp db query "SELECT p.post_title AS code, \
FROM_UNIXTIME(MAX(CASE WHEN m.meta_key = 'date_expires' THEN m.meta_value END)) AS expires, \
MAX(CASE WHEN m.meta_key = 'usage_count' THEN m.meta_value END) AS used, \
MAX(CASE WHEN m.meta_key = 'usage_limit' THEN m.meta_value END) AS usage_limit \
FROM wp_posts p JOIN wp_postmeta m ON m.post_id = p.ID \
WHERE p.post_type = 'shop_coupon' AND p.post_status = 'publish' GROUP BY p.ID"
Replace wp_ with your table prefix. Look for rows where expires is in the past, or where used
has reached usage_limit. An empty expires means the coupon has no end date, and an empty or zero
usage_limit means no limit.
How to fix it
- If the promotion should go on, extend the end date or raise the usage limit.
- If it is over, move the coupon to the trash instead of leaving it published. Orders keep the code they used, so nothing in your order history breaks.
- For codes that leaked into places you don’t control, decide on purpose: either honor them with a new end date, or retire them and accept the checkout error. Leaving it undecided is what costs money.
- Search your newsletters and affiliate material for the code before you trash it, so you know what customers will have seen.
When it’s a false alarm
- Coupons kept published for a workflow that needs them out of the trash, such as reporting.
- Per-customer limits. One customer reaching
usage_limit_per_useris not the same as the coupon’s overallusage_limitrunning out, and only the second one is a finding. - Codes reused every season, expired now and switched back on in three months.
How Merchlint finds it
Merchlint reads every published shop_coupon and reports one that can no longer be used: its
date_expires is in the past, or its usage_count has reached its usage_limit. A coupon with
both problems gets one finding, not two. If the end date field holds something WooCommerce cannot
read as a date, which makes WooCommerce reject the coupon as expired, Merchlint reports that as a
separate reason and shows what is in the field.
Each finding shows the coupon code, the reason, the end date and how many days ago it passed, the usage limit, and how many times the coupon was used. A coupon with no end date and no usage limit is never reported.
Confidence: F—fact from the database. A date is before today or it is not; a counter has reached its limit or it has not.
This check is part of the Pro add-on, which is still being prepared. The free plugin does not run it.
Install freeDoesn't match what you see in your store? Email us—we read every message. contact@merchlint.com