Ahosting Logo
Knowledge Base

How to Set Up WooCommerce Coupons and Discounts

The settings that cost money are the restrictionsWhat people set· the discount amount· and an expiry dateWhat they forget· a minimum spend· a usage limit overall and per customer· excluded products or categories· whether it stacks with other couponsHow it goes wrongA percentage code with no maximum spend and no usage limit, shared publicly, applied toeverything including the expensive items.

Coupons in WooCommerce are straightforward to create and easy to configure in ways that cost money. The settings that matter are the restrictions, not the discount.

Creating one

Marketing then Coupons then Add coupon. Three tabs: the discount itself, usage restrictions, and usage limits.

The code is what customers type. Make it readable when spoken aloud: a code with an I, a 1 and an l in it generates support messages.

Discount types

Percentage applies to the cart total. Simple, and it scales with order size in a way that can be expensive on large orders unless capped by a maximum spend restriction.

Fixed cart discount takes an amount off the whole order.

Fixed product discount takes an amount off each qualifying item, note each. A £5 product discount on a cart with ten qualifying items is £50, which surprises people.

The restrictions are the important tab

Minimum spend. Prevents a discount intended for a large order being used on a single cheap item.

Maximum spend. Caps the exposure on a percentage discount.

Individual use only. Stops the coupon combining with others. Without it, customers stack codes in combinations you did not intend, and some of those combinations are below cost.

Exclude sale items. Otherwise a discount applies on top of an existing reduction.

Products and categories. Limits what the discount applies to.

The first three are where money is lost. A percentage code with no maximum spend, no individual-use restriction and no expiry is an open-ended liability.

Usage limits

Limit per coupon caps total redemptions.

Limit per user caps how many times one customer may use it, though this is enforced by email address on the account, so it is a speed bump rather than a wall for guest checkout.

Set an expiry date on every coupon. A promotional code from two years ago still working is the most common way a store quietly loses margin, because codes circulate on voucher sites long after the campaign ended.

Free shipping via coupon

A coupon can grant free shipping, but only if the shipping zone has a free shipping method configured to require a coupon. Both halves are needed, and configuring only the coupon produces a code that appears to work and does not remove the shipping cost.

Test before publishing the code

Place a test order with the coupon and confirm the discount is what you intended.

Test specifically: below and above any minimum spend, with a sale item if you excluded them, and in combination with another active coupon if you did not set individual use. That last one is where the expensive surprises are.

Check the tax behaviour

Whether a discount is applied before or after tax affects the final total, and it should match how you display prices.

A store showing tax-inclusive prices with a discount applied to the pre-tax amount produces a total customers cannot reconcile with the advertised discount, which generates support messages on every order.

Turning coupons off entirely

Worth knowing: the coupon field on checkout prompts some customers to leave and search for a code, and they often do not come back.

If you do not run promotions, disabling coupons removes that prompt. It is a real conversion consideration instead of a technical one.

Keep a record

Which codes exist, what they do, when they expire, and which campaign they belong to. WooCommerce shows usage counts, but not why a code was created.

A year on, a list of active coupons nobody can explain is a list nobody will safely delete, and they keep being redeemed.

A discount that does not apply cleanly at checkout costs more than it gains. There is more on testing the whole path a customer takes in WooCommerce Checkout Optimization.

Check what a coupon actually does to the total

Discount rules interact with tax and shipping in ways that are easier to test than to reason about.

wp db query "SELECT p.post_title AS kod, m.meta_key, m.meta_value
  FROM wp_posts p JOIN wp_postmeta m ON m.post_id=p.ID
  WHERE p.post_type='shop_coupon' AND m.meta_key IN
  ('discount_type','coupon_amount','free_shipping','usage_limit','expiry_date') LIMIT 20;"

Then place a real order using the code and read the totals line by line. A percentage discount applied before or after tax produces different figures, and which one is correct depends on where you trade rather than on preference.

Test with a basket containing more than one item and at least one item on a different tax rate. Single item tests pass on configurations that break on real baskets.

Coupons that can be used more than intended

The restrictions tab is where the money is lost, and the defaults are permissive.

wp db query "SELECT p.post_title, m.meta_value AS limit_per_coupon
  FROM wp_posts p LEFT JOIN wp_postmeta m ON m.post_id=p.ID AND m.meta_key='usage_limit'
  WHERE p.post_type='shop_coupon' AND (m.meta_value IS NULL OR m.meta_value='');"

A code with no usage limit can be shared publicly and used indefinitely, which is how a discount intended for one customer ends up on a voucher site.

Set a total limit, a per customer limit and an expiry on every code, including the ones created for a single person. The per customer limit is the one most often left blank and the one that matters most for a code that leaks.

Watch what the codes are costing

Coupons are created individually and reviewed collectively almost never.

wp db query "SELECT p.post_title, m.meta_value AS kullanim
  FROM wp_posts p JOIN wp_postmeta m ON m.post_id=p.ID AND m.meta_key='usage_count'
  WHERE p.post_type='shop_coupon' ORDER BY CAST(m.meta_value AS UNSIGNED) DESC LIMIT 10;"

A code with far more uses than the campaign intended is either public or being reused, and both are worth knowing before the next statement rather than after.

Expire codes rather than deleting them, so the order history still explains why those orders were discounted. Deleting a coupon leaves past orders referencing something that no longer exists. Reading analytics and reports covers the wider picture.

Plan the end of a campaign, not just the start

A discount code is created for a period and removed when somebody remembers, which is usually after the period ended. Set the expiry at creation, even for a code with no announced end date, since a code that expires can be extended and one that never expires is discovered on a voucher site. Decide beforehand what happens to a customer who tries an expired code at checkout, because a refusal with no explanation is an abandoned basket rather than a saved discount.