Type something to search...
How to Add Coupons and Discounts in WooCommerce?

How to Add Coupons and Discounts in WooCommerce?

Coupons are one of WooCommerce's built-in features, but making them actually drive sales takes more than typing a discount code into a settings screen. WooCommerce ships with a genuinely capable coupon system out of the box: percentage discounts, fixed cart or product discounts, free shipping, usage limits, and restrictions by product, category, or minimum spend, all without installing a single extra plugin.

This guide covers creating and configuring coupons from the WooCommerce admin, the restriction settings people usually miss (and end up giving away far more discount than intended), and how to register an entirely custom coupon discount type using WooCommerce's actual filter hooks, for when the built-in types don't cover what you need.

Step 1: Enable Coupons

Coupons are enabled by default in current WooCommerce versions, but it's worth confirming. Go to WooCommerce → Settings → General and check that Enable the use of coupon codes is ticked. Without it, the coupon field simply won't appear on the cart or checkout page, no matter how many coupons you've created.

Step 2: Create a Coupon

Go to Marketing → Coupons → Add coupon (in older WooCommerce versions this lives directly under the WooCommerce menu). Give it a Coupon code — this is the exact string customers will type in, so keep it short and free of ambiguous characters (avoid mixing 0 and O, or 1 and l).

Under Coupon data, work through each tab:

General

  • Discount type — Percentage discount, Fixed cart discount, or Fixed product discount.
  • Coupon amount — the value applied, interpreted according to the discount type above.
  • Allow free shipping — ties this coupon to any shipping method you've marked as requiring a free-shipping coupon under your shipping zones.
  • Coupon expiry date — leave blank for a coupon with no expiration, or set a date to auto-disable it.

Usage restriction

This tab is where most coupon mistakes happen. Restrictions here include:

  • Minimum/maximum spend — prevents a 20% off coupon meant for large orders from applying to a single $5 item.
  • Individual use only — stops this coupon from stacking with other coupons in the same order.
  • Exclude sale items — prevents customers from combining an already-discounted sale price with a further coupon discount, unless that's genuinely your intent.
  • Products / Exclude products and Product categories / Exclude categories — scope the coupon to exactly the products it should apply to.

Usage limits

  • Usage limit per coupon — a hard cap on total redemptions, useful for a limited-quantity promotion.
  • Usage limit per user — prevents one customer from applying the same code repeatedly across multiple orders.

Step 3: Test the Coupon Before Promoting It

Add a qualifying product to a test cart, apply the coupon code, and confirm the discount amount, any restrictions, and free shipping (if enabled) all behave as expected. Then deliberately test a case that should fail, an excluded product, or an order below the minimum spend, to confirm the restriction actually blocks it rather than silently applying anyway.

Step 4: Register a Custom Coupon Discount Type

WooCommerce's three built-in discount types cover most cases, but sometimes you need genuinely custom logic, for example, a "buy one get one 50% off" style discount, or a coupon that discounts based on a rule the built-in types can't express. WooCommerce exposes exactly the filters needed to register a new coupon type. Add this to your theme's functions.php or a site-specific plugin:

// Register the new discount type so it appears in the Discount Type dropdown.
add_filter( 'woocommerce_coupon_discount_types', function ( $discount_types ) {
    $discount_types['fixed_per_item_over_two'] = __( 'Fixed discount per item (2+)', 'textdomain' );
    return $discount_types;
} );

// Define how much discount this coupon type actually applies to a cart item.
add_filter( 'woocommerce_coupon_get_discount_amount', function ( $discount, $discounting_amount, $cart_item, $single, $coupon ) {
    if ( 'fixed_per_item_over_two' !== $coupon->get_discount_type() ) {
        return $discount;
    }

    // Only apply once the customer has 2 or more of this item in their cart.
    if ( $cart_item['quantity'] < 2 ) {
        return 0;
    }

    $coupon_amount = $coupon->get_amount();

    return $single ? $coupon_amount : $coupon_amount * $cart_item['quantity'];
}, 10, 5 );

A few things worth understanding here:

  • woocommerce_coupon_discount_types just adds an entry to the dropdown you see in the admin's Coupon data → General tab; it doesn't define any discount logic on its own.
  • woocommerce_coupon_get_discount_amount is where the actual calculation happens, and it fires per cart item, so always check $coupon->get_discount_type() first and return the original $discount unmodified for every other coupon type, or you'll break every existing coupon on the store.
  • The $single parameter tells you whether WooCommerce wants the discount for a single unit of the item or the full line total; getting this backward is the most common bug in custom coupon logic, since it silently doubles or halves the discount shown at checkout.

Step 5: Track Which Coupons Actually Drive Sales

A coupon that never gets redeemed isn't doing anything for you, and a coupon that gets over-redeemed can quietly erode margin without anyone noticing until the monthly numbers come in. WooCommerce's Analytics → Coupons report (under the newer Analytics dashboard) breaks down usage count, total discount amount given, and net sales attributed to each coupon, which is the fastest way to see whether a specific promotion is paying for itself.

A few habits worth building around this report:

  • Review it after every campaign, not just at the end of the quarter, so you can catch a coupon that's underperforming (or being abused past its intended usage limit) while there's still time to adjust it.
  • Compare discount given against net sales, not just redemption count. A coupon redeemed a hundred times on your cheapest product tells a very different story than one redeemed a hundred times across your highest-margin items.
  • Watch for coupon codes leaking onto public deal sites. A code intended for an email list or a specific affiliate sometimes ends up posted publicly, at which point usage limits (covered in Step 2) are what actually cap the damage rather than the code's intended audience.

Common Discount Strategies Beyond Simple Coupons

  • Sale prices set directly on a product (via the Regular price / Sale price fields) work well for straightforward markdowns and don't require a customer to know or enter a code.
  • Bulk/quantity discounts typically need a dedicated extension (like WooCommerce's own "Dynamic Pricing" style plugins), since the core plugin's coupon system isn't built for tiered per-quantity pricing.
  • Cart abandonment discount emails, offering a coupon to customers who leave items in their cart, are covered in the cart abandonment guide, which pairs naturally with everything in this post.

Frequently Asked Questions (FAQ) About WooCommerce Coupons

The most common causes are an expired coupon, a usage restriction that excludes the products currently in the cart, or the cart total falling below a configured minimum spend. Open the coupon in the admin and check the General and Usage restriction tabs against the exact cart contents you're testing with.

Only if neither coupon has "Individual use only" checked under Usage restriction. If either coupon has that box ticked, WooCommerce blocks stacking and shows an error when a second code is applied.

WooCommerce's core coupon settings don't have a native "first order only" restriction; this typically requires a small custom function checking the customer's order history via wc_customer_bought_product() or a dedicated extension, since the built-in restriction options are based on cart contents and spend, not purchase history.

Yes, using wc()->cart->apply_coupon( 'CODE' ) triggered from a hook like woocommerce_before_cart, though this is a code-level customization rather than a settings-screen option. Several marketing plugins also offer this as a built-in feature if you'd rather not write the function yourself.

Yes. A coupon scoped to a parent variable product, or to the category it belongs to, applies across all of its variations automatically. If you need a discount on only one specific variation, you'll generally need a custom filter, since WooCommerce's product restriction targets the parent product by default.

A Fixed cart discount subtracts a flat amount from the entire cart total once, regardless of how many items are in it. A Fixed product discount subtracts that amount from each qualifying product in the cart individually, so it scales with quantity.

Yes, under Usage restriction there's an "Allowed emails" field where you can list one or more email addresses (wildcards like *@company.com are supported), restricting redemption to only those accounts or addresses.

Conclusion

WooCommerce's coupon system covers the vast majority of discount strategies a store needs without any custom code: percentage and fixed discounts, free shipping, usage limits, and restriction rules that prevent a promotion from being applied more broadly than intended. The Usage restriction tab deserves the most attention during setup, since a missing minimum spend or exclusion rule is the most common way a coupon ends up costing far more than planned.

For genuinely custom discount logic the built-in types can't express, woocommerce_coupon_discount_types and woocommerce_coupon_get_discount_amount are the real, documented extension points, and the pattern shown above (register the type, then branch on get_discount_type() inside the calculation filter) generalizes to almost any custom coupon behavior you might need.

Coupons work best as part of a broader strategy rather than in isolation, whether that's recovering abandoned carts with a well-timed discount code or pairing a coupon with a specific landing page built around a single promotion.

Tags :
Share :

Related Posts

Effortlessly Crafting Compelling WordPress Pages

Effortlessly Crafting Compelling WordPress Pages

As a website owner or content creator, having the ability to seamlessly add new pages to your WordPress site is crucial. Whether you're introducing a

Continue Reading
High Traffic Tips for WordPress Mastery 🚥

High Traffic Tips for WordPress Mastery 🚥

In our digital age, where online visibility is paramount, ensuring your WordPress site can handle surging traffic is crucial. Just like a finely-tune

Continue Reading
How Do I Change the WordPress Login URL?

How Do I Change the WordPress Login URL?

By default, every WordPress site's login page lives at the same predictable address: yoursite.com/wp-login.php (which also happens to redirect from

Continue Reading