Coupons, in this case WooCommerce coupons, can help boost sales in your online store. You can move products faster, sell more of them, and even bring more traffic to your site with the right coupons.
Coupons can also help build brand awareness, encourage customer loyalty, and potentially cut advertising costs.
In this guide, I’ll show you how to add coupons in WooCommerce stores, then walk through the available coupon options and settings. I retook every screenshot on a clean WooCommerce 11.3 store, so the fields shown here match the current admin screens. If you’re looking for a basic guide to building a store with WooCommerce, see Building a Virtual Store in WordPress using WooCommerce.
First, you need to enable coupons in WooCommerce. Go to WooCommerce > Settings > General, then under “Enable coupons,” check Enable the use of coupon codes and save the settings.
You’ll find more on the “Calculate Coupon Discounts Sequentially” option later in the post.
Adding a Coupon in WooCommerce Stores
To add a coupon in a WooCommerce store, follow these steps:
- In the WordPress admin interface, go to Marketing > Coupons.
- Create a new coupon by clicking Add new coupon, or edit an existing one.
- Fill in the following fields:
- Coupon Code – the code a customer enters to redeem the coupon. You can type one yourself or click Generate coupon code to create a random one.
- Coupon Description (Optional) – an internal note, such as who the coupon is for or which campaign it belongs to. Customers won’t see it.
WooCommerce saves coupon codes in lowercase, so customers can enter TEAM20 or team20, and both will work. Codes should be unique. If you save a code that already exists, WooCommerce shows a warning, and customers receive the most recent coupon with that code.
The Coupons screen lists every coupon along with its type, amount, usage count, and expiry date. That makes it easy to see which codes are active and how often they’ve been used:
The Coupon Data section has three tabs where you can add restrictions and configure extra settings: General, Usage Restriction, and Usage Limits. Let’s look at each one.
General
In the General tab, you set the discount type, amount, and expiry date.
- Discount Type:
- Percentage Discount – a percentage off qualifying items in the cart. Without product restrictions, that means every item. For example, if the cart contains three shirts priced at $20 each (total $60), a 10% coupon gives a $6 discount.
- Fixed Cart Discount – a fixed discount for the whole cart. A $10 discount of this type means $10 off, regardless of how many items are in the cart.
- Fixed Product Discount – a fixed discount for specific products only. The customer receives the discount on each qualifying product. If you add three specific shirts, each gets a $10 discount (total $30 off).
- Coupon Amount – a fixed number or percentage, depending on the discount type you chose. There’s no need to add a currency symbol or percentage sign, WooCommerce handles that automatically.
- Allow Free Shipping – lets the customer choose free shipping when using the coupon. For this to work, the shipping zone needs a Free Shipping method, and that method’s “Free shipping requires” setting must include “A valid free shipping coupon”.
- Coupon Expiry Date – the date the coupon expires. It expires at 00:00 (midnight) on the selected date.
Usage Restriction
This tab controls when and where the coupon can be used.
The coupon in the screenshot is a staff discount. It requires a $50 cart, can’t be combined with other coupons, and can’t be used on sale items. It applies to clothing (excluding accessories and one product), from one brand only, and only staff email addresses can use it.
- Minimum Spend – the minimum cart subtotal (before shipping) needed for the coupon to be valid. The subtotal includes tax only if your store displays prices with tax in the cart.
- Maximum Spend – the maximum subtotal after which the coupon no longer applies.
- Individual Use Only – check this if you don’t want the coupon used alongside other coupons.
- Exclude Sale Items – check this if you don’t want the coupon to apply to items already on sale.
- Products – the products the coupon applies to. With a “Fixed cart discount”, these are the products that must be in the cart for the discount to apply.
- Exclude Products – products the coupon won’t apply to. With a “Fixed cart discount”, the coupon won’t work if one of these products is in the cart.
- Product Categories – categories the coupon applies to. With a “Fixed cart discount”, a product from one of these categories must be in the cart.
- Exclude Categories – categories the coupon won’t apply to. With a “Fixed cart discount”, the coupon won’t work if a product from one of these categories is in the cart.
- Allowed Emails – the email addresses that can use the coupon, separated by commas. You can use an asterisk as a wildcard:
*@gmail.commatches every Gmail address. WooCommerce checks the list against the customer’s account email and billing email. - Product Brands / Exclude Brands – limit the coupon to products from specific brands, or exclude particular brands. These fields appear because brands are now built into WooCommerce.
You’ll notice the small AND labels between the field groups. A coupon has to pass every group you fill in: the spend rules, products, categories, emails, and brands.
If you leave all the product, category and brand fields empty, the coupon is valid for your entire store.
Usage Limits
This tab lets you set how many times a coupon can be used.
- Usage Limit Per Coupon – the total number of times customers can redeem the coupon before it becomes invalid. Leave this empty for unlimited use.
- Limit Usage to X Items – the maximum number of individual items the coupon can apply to in a single order (relevant for product-level discounts).
- Usage Limit Per User – the number of times one customer can use the coupon. WooCommerce identifies guests by billing email and logged-in customers by their user account.
Once you have configured the coupon for your needs, click Publish. The coupon is then ready to use.
Sending Coupons to Customers
Once you publish a coupon, you can share the coupon code with your customers. Copy the code and send it by email, social media, or any other channel you use.
You can also apply or remove a coupon on an existing order from WooCommerce > Orders. Open the order and click Apply coupon. This button only appears while you can still edit the order, meaning its status is Pending payment or On hold.
How Customers Use Coupons
Customers enter the code on the cart or checkout page. In the Cart and Checkout blocks, which new WooCommerce stores use by default, the field appears under Add coupons in the order summary. Once applied, the code appears as a removable tag next to the discount:
If a coupon does not meet one of its rules, such as the minimum spend, WooCommerce rejects it and shows an error message explaining why.
Calculate Coupon Discounts Sequentially
By default, WooCommerce calculates coupon discounts in parallel. So when multiple coupons are applied to a cart, WooCommerce calculates each one from the original product or cart total, without factoring in the other discounts.
Turning on calculate coupon discounts sequentially changes that. In sequential mode, WooCommerce applies coupons one after another, calculating each new discount from the amount left after the previous discount.
This is handy when you combine different coupon types, such as a percentage-based discount followed by a fixed amount discount. It makes those calculations more accurate and fair.
Need More Options for Managing Coupons?
Core WooCommerce handles the basics, but a few common requests need an extension: coupons that apply automatically, shareable coupon links, gift cards and store credit. One popular option is Smart Coupons by StoreApps, sold on the WooCommerce Marketplace. It lets you:
- Create shareable URLs that apply a coupon automatically.
- Apply discounts automatically when products are added to the cart.
- Sell gift cards and give customers store credit.
- Run BOGO offers and generate coupon codes in bulk.
At the time of writing, it costs $99 per year. Check the extension page for the current price.
Bonus – Changing or Removing the Coupon Text
Since someone requested this in the comments, let’s look at how to change the coupon-related text on the cart and checkout pages. The code depends on which cart and checkout your store uses: the classic templates (shortcodes) or the Cart and Checkout blocks. I tested every snippet below on WooCommerce 11.3.
Classic Cart and Checkout
The following code changes “Have a coupon?”, “Coupon code” and “Apply coupon” to custom text. Add it to your child theme’s functions.php file, then change the text in lines 3, 14 and 16:
// Change the coupon message on the classic checkout page
function my_store_checkout_coupon_message( $message ) {
return 'Have a customer code? <a href="#" role="button" aria-label="' . esc_attr__( 'Enter your coupon code', 'woocommerce' ) . '" aria-controls="woocommerce-checkout-form-coupon" aria-expanded="false" class="showcoupon">' . esc_html__( 'Click here to enter your code', 'woocommerce' ) . '</a>';
}
add_filter( 'woocommerce_checkout_coupon_message', 'my_store_checkout_coupon_message' );
// Change the coupon field on the classic cart page
function woocommerce_rename_coupon_field_on_checkout( $translated_text, $text, $text_domain ) {
if ( is_admin() || 'woocommerce' !== $text_domain ) {
return $translated_text;
}
if ( 'Coupon code' === $text ) {
$translated_text = 'Customer Code';
} elseif ( 'Apply coupon' === $text ) {
$translated_text = 'Apply Code';
}
return $translated_text;
}
add_filter( 'gettext', 'woocommerce_rename_coupon_field_on_checkout', 10, 3 );
Cart and Checkout Blocks
The gettext filter above does not affect the blocks. Their labels (“Add coupons”, “Enter code”) are translated in JavaScript, so the PHP filter never sees them. Instead, hook into the JavaScript translation filter WordPress provides in wp.i18n:
// Change the coupon labels in the Cart and Checkout blocks
function my_store_block_coupon_labels() {
if ( ! is_cart() && ! is_checkout() ) {
return;
}
wp_add_inline_script( 'wp-i18n', "
wp.hooks.addFilter( 'i18n.gettext_woocommerce', 'my-store/coupon-labels', function ( translation, text ) {
if ( 'Add coupons' === text ) return 'Have a customer code?';
if ( 'Enter code' === text ) return 'Customer code';
return translation;
} );
" );
}
add_action( 'wp_enqueue_scripts', 'my_store_block_coupon_labels' );
The filter checks the original English text, so it still works when your store runs in another language. Change the replacement text in lines 8 and 9.
Hiding the Coupon Field
To hide the coupon field on the cart page, the checkout page, or both, use the code below. It uses the woocommerce_coupons_enabled filter, which hides the field in the classic templates and the Cart and Checkout blocks:
// Hide the coupon field on the cart page
function hide_coupon_field_on_cart( $enabled ) {
if ( is_cart() ) {
$enabled = false;
}
return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field_on_cart' );
// Hide the coupon field on the checkout page
function hide_coupon_field_on_checkout( $enabled ) {
if ( is_checkout() ) {
$enabled = false;
}
return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field_on_checkout' );
Hiding the field doesn’t turn coupons off. To stop customers from using coupons altogether, uncheck Enable the use of coupon codes in WooCommerce > Settings > General.
FAQs
Here are some common questions about WooCommerce coupons:
WC()->cart->apply_coupon() when your conditions are met.
*@yourcompany.com. WooCommerce matches them against the customer's account email and billing email. You can also set a "Usage Limit Per User" to limit how many times each person can redeem it.
woocommerce_coupons_enabled filter also hides the coupon field in the blocks, but PHP gettext filters don't change the block labels. For those, use the JavaScript i18n.gettext_woocommerce filter shown in the Bonus section.
SUMMER15, Summer15 and summer15 all redeem the same coupon.
That’s it. I hope this guide helped. If it did, feel free to share in the comments. Good luck!
