Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Coupon error message unclear: how to find and fix it

CNV-173Low impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

When a shopper types a discount code at checkout and it fails, your store shows an error message. This issue is when that message is vague, technical or missing. Examples: 'Invalid code', 'Coupon is not valid', 'Error 400', or a red box that appears with no text at all.

A code can fail for many reasons: it has expired, the cart is under the minimum spend, the code only works on certain products, it was already used, or the shopper made a typo. One generic message hides all of these.

Why it costs you leads or sales

A shopper who has a code in hand expects a discount. If the code fails and the message does not explain why, they do not know whether to retype it, add more to the cart or give up. Some will leave to search for another code. Some will abandon the purchase. Others will contact support, which costs you time.

The impact is usually low per visit, because only shoppers who use a code are affected. But these shoppers are close to buying, and you often sent them the code yourself in an email or ad.

Where a vague coupon error loses the sale
  1. CartShopper has items and a promo code
  2. Enter codeCode is typed and applied
  3. Vague error'Invalid code' with no reason
  4. PaymentShopper hesitates or leaves
  5. OrderSale not completed

The shopper is ready to pay, but the unclear message stops the journey.

Shoppers who hit a coupon error and still buyExample numbers
Shoppers who hit a coupon error and still buy (example)Vague message: 35 %; Clear message: 60 %023463560Vague messageClear message%

Example: illustrative numbers only. A clear message with a next step keeps more shoppers than a vague one.

How to check if your site has it

Open your store in a private browser window, add a product to the cart and go to the coupon field. Then try each failure case on purpose and read what appears.

Failure cases to test
  • A random made-up code such as TESTXYZ
  • A valid code with a typo or extra space
  • An expired code
  • A code with a minimum spend, with the cart below it
  • A code limited to certain products or collections, with other items in the cart
  • A single-use code that was already used
  • A code entered in lowercase when it is stored in uppercase
  • The same checks on a phone, where the message may be cut off or hidden

For each case, ask: does the message say why it failed? Does it say what to do next? Is it visible without scrolling? Is it readable by screen readers? If any answer is no, fix that message.

How to fix it

Good coupon messages are short, name the reason and give a next step. Example: 'This code needs a cart of at least $50. Add $12 more to use it.' Where your platform only offers one generic message, you can often reword it, or add helper text under the field.

Example rewrites for common failures
CauseVague messageClearer message
ExpiredInvalid codeThis code expired on 31 May. Check your latest email for a new one.
Minimum spendCoupon not validThis code needs a cart of at least $50.
Wrong productsErrorThis code does not apply to the items in your cart.
Already usedInvalid codeThis code has already been used.
TypoInvalid codeWe could not find that code. Check the spelling and try again.
Change the coupon error message by platform
  1. Find out which messages you can change

    WooCommerce has built-in messages for each failure case. Test each case first, so you know which ones are unclear.

  2. Reword with a filter

    Add a snippet to a child theme's functions.php or a code snippets plugin. Use the woocommerce_coupon_error filter (shown below) to replace the text for a given error code.

  3. Set the specific details on the coupon

    Under Marketing > Coupons, check the minimum spend, product restrictions and expiry date so the built-in messages are accurate.

WooCommerce: reword a coupon errorphp
add_filter( 'woocommerce_coupon_error', function ( $err, $err_code, $coupon ) {
    if ( $err_code === WC_Coupon::E_WC_COUPON_MIN_SPEND_LIMIT_NOT_MET ) {
        return 'This code needs a larger cart. Check the minimum spend and add more items.';
    }
    if ( $err_code === WC_Coupon::E_WC_COUPON_EXPIRED ) {
        return 'This code has expired. Check your latest email for a new one.';
    }
    return $err;
}, 10, 3 );
Coupon message before and after

Before

  • 'Invalid code' for every failure
  • No next step
  • Message hidden on mobile

After

  • Message names the reason
  • Says what to do next
  • Visible next to the field and announced to screen readers

How to confirm it's fixed

Confirm the new messages
  1. Repeat every failure case

    Use the list above in a private window and read each message.

  2. Check on mobile

    Make sure the message is visible without scrolling and not cut off.

  3. Check a valid code still works

    Apply a working code and confirm the discount shows and the total is correct.

  4. Ask someone unfamiliar

    Ask a colleague to try a failing code and say what they would do next.

How to prevent it happening again

Keep coupon messages clear
  • Test the failure cases after theme, plugin or checkout changes
  • State minimums, dates and product limits wherever you promote a code
  • Review messages when you launch a new type of discount
  • Keep a short list of approved wording for each failure
  • Check support emails for people confused by codes

How FunnelGuard handles this

FunnelGuard detects this issue only partly. A check can enter a deliberately invalid code in your checkout journey and assert that specific text appears. You tell it which words to expect, such as 'expired' or 'minimum', and it flags the run if that text is missing, for example after a theme update replaces your message with a generic one.

What it does not do: judge whether a message is actually clear or helpful to a human. It cannot tell if your wording makes sense, if the tone suits your brand, or if the message is easy to see on every phone. It only confirms the text you chose is present.

The Free plan covers 1 site and 2 journeys with daily checks and no card needed. Paid plans start at $39/month with a 3-day free trial. A free read-only website audit is also available.

Questions people ask

Why does my coupon say 'invalid code' when the code is right?

The code may exist but fail a rule, such as an expired date, a minimum spend, product limits or a usage cap. Many platforms show the same generic message for all of these. Check the discount settings and test each condition to find the cause.

How do I change the coupon error message in WooCommerce?

Use the woocommerce_coupon_error filter in a child theme's functions.php or a code snippets plugin. Check the error code it receives and return your own text for that case. Test each failure afterwards.

Can I edit the discount code error message in Shopify?

Shopify's discount errors are mostly fixed text. Where your theme exposes it, you can edit text under Online Store > Themes > Edit default theme content. Otherwise add helper text near the field and state the rules where you promote the code.

What should a good coupon error message say?

It should name the reason and give a next step. For example: 'This code needs a cart of at least $50. Add more items to use it.' Keep it short, visible next to the field and readable by screen readers.

Does an unclear coupon message really lose sales?

It can. Shoppers with a code are close to buying, and a vague error leaves them guessing. Some will leave to look for another code or abandon the cart. The effect is usually low per visit but easy to fix.

Should the message say whether a code exists?

Say what the shopper needs to fix, but avoid hints that help guessing valid codes. 'We could not find that code, check the spelling' is fine. Do not list codes or show their format.

Can FunnelGuard tell me if my coupon error message is clear?

Not fully. FunnelGuard can enter an invalid code and assert that expected text appears, so it catches a missing or changed message. It cannot judge whether the wording is clear to a person, so review that by hand.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: assert text.

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.