Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Expired coupon still accepted at checkout: how to find and fix it

CNV-166Medium impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

A coupon has an end date. After that moment the checkout should reject it with a message such as "This coupon has expired". With this issue, the code is still accepted and the discount is applied to the order.

It is the opposite of a valid coupon being rejected. Here the shop is too generous, and the problem is easy to miss because nobody complains about a discount that works.

Why it costs you leads or sales

The cost is margin, not traffic. Orders still arrive, but at a price you no longer meant to offer. Expired codes also get shared on coupon sites and forums, so the leak can grow after the promotion ends.

It can also hurt your next promotion. If shoppers learn that old codes keep working, they wait for a discount instead of buying at full price. Your reports then show sales that look healthy while profit per order drops.

Order margin with and without a leaking couponExample numbers
Order margin with and without a leaking coupon (example)Full price order: 40 % margin; Intended promo order: 28 % margin; Expired code order: 28 % margin01531402828Full price orderIntended promo orderExpired code order% margin

Example: illustrative numbers showing how an expired 20% code that keeps working lowers average order margin.

Where the expiry check fails
  1. Promotion endsEnd date passes
  2. Shopper enters old codeFound on a coupon site
  3. Expiry checkWrong time zone, no end date or cache
  4. Discount appliedOrder placed at reduced price

The promotion ends, but the checkout never enforces the end date.

How to check if your site has it

Run a negative test: use a code you know has expired and confirm it is refused. Do it in a private window so no old cart or cookie interferes.

Test an expired coupon by hand
  1. List your expired codes

    Open your coupon or discount list and note codes whose end date has passed. Include codes from old email campaigns.

  2. Open a private window

    Add a product to the cart as a guest so you start with a clean session.

  3. Enter the expired code

    Apply it in the cart and at checkout. A correct store shows an error and the total does not change.

  4. Test around the cut-off

    Create a test code that ends in a few minutes. Try it before and after the end time to catch time zone mistakes.

  5. Try other entry points

    Test any discount link, the mobile checkout and any express payment button, since each may check the code differently.

How to fix it

Start by finding out which cause applies. The usual ones are below.

Common causes of an expired coupon still working
CauseWhat you seeFix
No end date setCode never expiresAdd an end date or deactivate the code
Time zone mismatchCode works for hours or a day after the endSet the end time explicitly in the store time zone
Cached cart or pageDiscount stays on a cart made earlierExclude cart and checkout from caching, clear the cart
Duplicate codeOld code is blocked but a similar one is activeSearch for codes with the same text and remove extras
Custom discount logicFront end rejects, server acceptsValidate the date on the server
Fix the expiry by platform
  1. Edit the coupon

    In WooCommerce go to Marketing > Coupons, open the code and set Coupon expiry date under General. Update the coupon.

  2. Check the site time zone

    Go to Settings > General and confirm the Timezone matches your business. WooCommerce expiry dates follow the site time zone and apply by date.

  3. Exclude cart and checkout from cache

    In your caching plugin, make sure the Cart and Checkout pages are never cached. Then clear the cache.

Example server-side expiry check (Node.js)javascript
function isCouponValid(coupon, now = new Date()) {
  if (!coupon.active) return false;
  if (!coupon.expiresAt) return false; // treat missing end date as invalid unless intended
  return now.getTime() < new Date(coupon.expiresAt).getTime();
}

// Run it when the code is applied AND when the order is placed
if (!isCouponValid(coupon)) {
  throw new Error('This coupon has expired');
}

How to confirm it's fixed

Confirm the fix
  • The expired code is refused in a private window with a clear message
  • The cart total does not change after entering it
  • A short-lived test code stops working right after its end time
  • The code is also refused on mobile and through any discount link
  • A cart created before expiry does not keep the discount at checkout
  • No duplicate code with the same text is still active

How to prevent it happening again

Prevention habits
  • Always set an end date and time when you create a promotion
  • Add a coupon expiry test to your promotion launch and wrap-up checklist
  • Review the coupon list monthly and delete codes you no longer use
  • Keep cart and checkout out of any page cache
  • Use unique codes per campaign so one leaked code is easy to retire
  • Re-test after theme, plugin or checkout changes
How an expired coupon leak unfolds
  1. Day 0

    Promotion ends but the code still works.

  2. Day 3

    The code appears on a coupon website.

  3. Day 10

    Discounted orders keep arriving, with no error to notice.

  4. Day 30

    A margin review spots the pattern and the end date is fixed.

How FunnelGuard handles this

FunnelGuard detects this issue only partly. A negative-path journey can assert the result: you set up a journey that enters a code you know has expired and checks that the checkout rejects it and the total does not drop. FunnelGuard runs that journey on a schedule from the EU or the US, re-checks a failure from a second region and sends one alert with a screenshot and a likely cause.

What it does not do: it does not discover expired codes for you, and it only tests the codes you give it. It does not review your full coupon list, spot duplicate codes, or find leaks through discount links, other devices or other entry points unless you add a journey for each. It also stops before payment unless your store's test mode is set up, so it checks the discount at the cart or checkout step, not on a completed order.

Cover the rest by hand: review your coupon list each month, test around the end time of every new promotion, and compare order totals in your reports with expected prices. The free plan includes 1 site and 2 journeys with daily checks and no card, and every paid plan has a 3-day free trial.

Questions people ask

Why is my expired coupon still working?

Usually the end date is missing, set in a different time zone, or not checked on the server. A cached cart or a duplicate code with the same text can also keep the discount alive. Check the coupon's end date first, then the store time zone.

How do I make a coupon expire automatically?

Set an end date and time on the coupon. In WooCommerce use the Coupon expiry date field, and in Shopify use Set end date under Active dates. In custom code, compare the stored expiry with the current time on the server.

Why does my discount code work a day after its end date?

This is often a time zone issue. WooCommerce applies expiry by date in the site time zone, and Shopify uses the store time zone for end times. Check both settings and test a short-lived code to see the real cut-off.

How do I test that an expired coupon is rejected?

Open a private window, add a product to the cart and enter a code you know has expired. The checkout should show an error and the total should stay the same. Also check the final order total, not only the message.

Can a cached cart keep an expired coupon active?

Yes. If a cart or checkout page is cached, or a discount was attached before expiry and never revalidated, the discount can survive. Exclude cart and checkout from caching and validate the coupon again when the order is created.

Can FunnelGuard detect an expired coupon that still works?

Partly. A negative-path journey can enter a known expired code and check that it is rejected. It only tests the codes you configure, so you still need to review your coupon list and other entry points by hand.

Should I delete expired coupons or just let them expire?

Deleting or deactivating old codes is safer, because it removes the risk of a wrong end date or time zone leaving them live. Keep a record of past campaigns first if you need reporting.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: negative-path journey can assert.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.