How to Set Up Automatic Coupons in WooCommerce

How to Set Up Automatic Coupons in WooCommerce

Did you know, over 90% of shoppers hunt for and use coupons while shopping online?

Yes, and this is not something new. Coupons have been influencing consumers for ages. In fact, 80% of people sign up for email lists just to receive coupon codes.

As a WooCommerce store owner, you can significantly boost your conversions, AOV (Average Order Value), and revenue by offering coupon discounts. However, there’s a catch.

Your customers still need to collect the coupon codes and manually apply them to the cart/checkout page. This may feel like a bit of a hassle to many in this era of automation.

If they are clicking a link/button/advertisement from an email or any other medium, they expect the discount to be automatically applied.

Now, the question is, can WooCommerce automatically apply coupon?

Yes, it can. To auto-apply coupons in WooCommerce, you can either use some custom codes in your theme file or use a dedicated plugin. Custom codes can allow you to automate the entire process or generate auto-apply coupon links. A dedicated plugin, on the other hand, makes the process effortless and safer.

In this article, we will guide you on how to set up automatic coupons in WooCommerce step-by-step – using all possible methods.

In addition, we will also explore advanced dynamic coupon methods to keep your customers coming back more often than you expect.

Let’s get started.

How to Set Up Automatic Coupons in WooCommerce?

Again, we will demonstrate WooCommerce apply coupon programmatically in 3 ways.

  1. Using a Dedicated Auto-Apply Coupon Plugin
  2. Using Custom Code
  3. Using an Advanced Dynamic Discount Plugin

The most direct and easiest auto apply coupon WooCommerce method is using a dedicated plugin. For this article, we will use a free plugin called “Smart Coupons For WooCommerce Coupons.”

This nifty WooCommerce auto apply coupon tool makes the process a breeze. Let us walk you through the steps on how to set up automatic coupons in WooCommerce for free.

Step 1: Install the Auto Apply Coupon WooCommerce Plugin

Log in to your WordPress admin panel and,

  • Go to Plugins >> Add New Plugin.
how to set up automatic coupons in WooCommerce
  • Search for Smart Coupons and install the plugin.
  • After activating, you will see a new menu called Smart Coupons.
coupon settings

This new menu basically redirects to Woo Commerce’s own coupon menu pages, except for the dedicated settings page.

Step 2: Create a Coupon Code

We assume you already know how to add coupon code in WooCommerce. If in case, you don’t see any coupon option, navigate to WooCommerce >> Settings >> General and checkmark the “Enable the use of coupon codes” box.

enable coupon

Next,

  • Go to Smart Coupons >> Add Coupon.
  • Set a coupon code at the top.
  • Select your target discount type.
  • Set the discount value.
coupon setting

Step 3: Configuring Automation for the Coupon

The plugin integrates additional features into the default WooCommerce coupon settings.

  • Checkmark the following box to apply the coupon automatically.
how to set up automatic coupons in WooCommerce

In addition to the WooCommerce apply coupon automatically feature, the plugin allows you to set the coupon start and end dates. You can also select where to display the custom coupon banner.

display banner

Step 4: Save and Test the Auto-Apply Coupon

  • Publish the coupon.
  • Add some products to the cart, and the coupon discount will automatically be applied.
how to set up automatic coupons in WooCommerce

Step 5: Auto-Apply Coupon Through Banner and URL

The plugin also lets you apply coupons through a custom banner or a special URL. This is especially useful when promoting your WooCommerce offers on platforms like social media, emails, or blog posts.

coupon URL

You can attach the coupon to a clickable element—such as a banner, image, or button—and when a customer clicks it, they’ll be redirected to the cart page with the discount already applied.

And even if the coupon doesn’t apply automatically, no worries. Customers won’t need to remember or manually enter the code. A simple click on the banner will still apply it for them.

click banner

You can customize the banner from Smart Coupons >> Settings >> Layouts.

banner design

How to Set Up Automatic Coupons in WooCommerce Using Custom Codes?

Suppose you want to avoid adding another plugin to your setup. In that case, you can insert custom code in your theme file to apply a WooCommerce coupon automatically—no extra bloat, no extra load.

Here’s how to set up automatic coupons in WooCommerce without a plugin.

Step 1: Create a Coupon in WooCommerce

Before anything else, you need an actual coupon.

  1. Go to Marketing >> Coupons.
  2. Click Add New Coupon.
  3. Give your coupon a name like FREESHIP or 10OFF.
  4. Set the discount type and amount.
  5. Publish the coupon.
create coupon

You’re done with this part. Next is the code.

Step 2: Add a Code Snippet to Auto-Apply the Coupon

Now, how to apply coupon in WooCommerce automatically using code?

We’ll tell WooCommerce to apply the coupon as soon as someone adds a product to the cart.

Copy this code snippet:

add_action( 'template_redirect', 'apply_custom_coupon_url' );

function apply_custom_coupon_url() {

if ( is_admin() || is_cart() || is_checkout() ) {

     $coupon_code = '10OFF'; // Replace with your actual coupon

     if ( ! WC()->cart->has_discount( $coupon_code ) ) {

         WC()->cart->apply_coupon( $coupon_code );

     }

}

}

This bit of code checks whether the coupon has already been applied. If not, it adds it to the cart.

Step 3: Where to Place the Code

You have three easy options:

  • Option 1: Add it to your child theme’s functions.php file.
  • Option 2: Add the code directly to Appearance>> Theme File Editor >> functions.php.
  • Option 3: Use a code snippets plugin like “Code Snippets” to paste it safely.

We will use option 2 for this article. However, we highly discourage this method because you have to update the code on every theme update.

Scroll down to the bottom of functions.php and paste the code into the empty spaces and update the file.

function file

Step 4: Test It Out

Now go to your site and add a product to your cart. The discount should appear automatically when you visit the cart page.

how to set up automatic coupons in WooCommerce

No coupon fields. No copy-pasting. Just smooth and simple automation.

Step 5: Apply WooCommerce Coupon via URL Automatically

Let’s say you want a coupon to apply when someone visits a link like:

“https://yourstore.com/cart/?coupon-code=10OFF”

Once they land on that page, the coupon should be auto-applied without needing to enter it manually.

Here’s How to Set It Up:

Add the following code to your theme’s functions.php file or through a code snippets plugin:

add_action( 'template_redirect', 'apply_coupon_via_url' );

function apply_coupon_via_url() {

if ( is_admin() || is_ajax() ) return;

if ( isset( $_GET['coupon-code'] ) && ! WC()->cart->has_discount( sanitize_text_field( $_GET['coupon-code'] ) ) ) {

     $coupon_code = sanitize_text_field( $_GET['coupon-code'] );

        WC()->cart->apply_coupon( $coupon_code );

     wc_add_notice( 'Coupon applied successfully!', 'success' );

}

}

How It Works:

  • It looks for ?coupon-code=YOURCODE in the URL
  • If it exists and hasn’t been applied yet, WooCommerce adds it to the cart
  • You’ll also see a success notice on the cart page

Step 6: Create Shareable Coupon Links

Now you can generate shareable coupon URLs like:

  • Social media post:
    https://yourstore.com/cart/?coupon-code=10OFF
  • Email CTA button:
    Use that same link in your newsletter
  • Banner image:
    Wrap the banner image in the coupon URL

When a customer clicks it, they land on your cart page with the discount already active. No need to type anything.

how to set up automatic coupons in WooCommerce

How to Set Up Automatic Coupons in WooCommerce Using Advanced Discount Plugin

Let’s be honest—throwing a generic “10% OFF” code at customers is like handing out participation trophies. Everyone gets one, nobody cares.

If you’re still relying on simple auto-apply coupons, you’re leaving money (and loyalty) on the table. Today’s shoppers crave personalized, “how’d they know?!” moments—not one-size-fits-all discounts.

That’s where advanced coupon strategies come in. Tools like the Disco plugin let you create dynamic, hyper-targeted offers that feel tailor-made. Think:

  • “Spend $100? Automatically unlock 15% off.”
  • “Gold members get secret discounts on new arrivals.”
  • “Floridians save 10% during hurricane season.”

These aren’t gimmicks—they’re profit boosters. Disco is an incredibly powerful discount plugin, and the best part is, it’s absolutely free.

Moreover, it comes packed with a plethora of condition filters that enable you to offer laser-targeted personalized discounts to cater to different audience segments. The plugin also allows multiple conditions to be added to a single campaign with AND/OR logic, making it more flexible.

Disco condition

Below, we’ll break down 3 advanced tactics that turn casual buyers into obsessed fans.

*Note: For the following demonstrations, we will combine Disco and our previous auto-apply coupon plugin, Smart Coupons.

1. Cart Conditional Discounts

You can turn “maybe” customers into “heck yes” by rewarding cart-conditional discounts. Set thresholds (e.g., 100 spent) to auto-unlock discounts—Customers feel rewarded for buying more, and your average order value climbs.

Why it works:

  • Nudges customers to hit spending thresholds (“Just $20 more for 15% off!”).
  • Boosts average order value without desperate price slashing.

Example:

“Spend $150 → auto-apply 20% off.”

How to Set Up Automatic Coupons in WooCommerce Based on Cart Condition?

  • Install and activate the Disco plugin.
Install Disco
  • Set up a new coupon. Select the Fixed Cart Discount type and leave the Coupon Amount field empty. Make sure you checkmark the Apply coupon automatically box.
how to set up automatic coupons in WooCommerce
  • Go to Disco and click the Create a Discount button.
Create discount
  • Give your campaign a name and select the Cart intent.
cart intent
  • Specify the target products and start and end dates.
all products
  • Select the Percentage Discount type and set the value.
set value
  • Click the Add Condition button.
  • Select the filter Cart Coupons.
cart coupons
  • Search and select the target coupon and hit the Add Another Condition button.
add coupon
  • Select the AND logic and select the Cart Subtotal filter.
add filter
  • Set the value along with the Greater Than Or Equal Operator.
select operator
  • Save and test. As soon as you add $150 worth of items to the cart, the plugin will auto-apply the coupon discount.
how to set up automatic coupons in WooCommerce

2. User Role-Based Discounts

VIPs hate digging for codes. Surprise your loyal customers with discounts that magically appear at checkout. Gold members? Subscribers? Treat them like royalty.

Why it works:

  • Rewards loyalty (VIPs, subscribers, repeat buyers).
  • Makes customers feel like insiders.

Example:

“Gold members get 25% off – no code needed.”

How to Set Up a User Role-Based Automatic Coupon in WooCommerce?

  • Create an empty WooCommerce coupon for specific user, just like the previous strategy.
how to set up automatic coupons in WooCommerce
  • Create a new rule and select the Cart intent.
cart intent
  • Select the products and set the percentage value.
  • Add and set the Cart Coupons condition.
  • Add another condition called User Role along with AND logic.
  • Type or scroll and select the target user role.
user role

Your Gold members can now enjoy a 25% discount automatically.

3. Bulk Purchase Discounts

Think Costco vibes!

The more your customers buy in a WooCommerce bulk discount, the more they save.

Why it works:

  • Encourages stockpiling (“Buy 5, save 20%”).
  • Perfect for consumables (skincare, snacks).

Example:

  • Buy 2-4 items, get a 10% discount
  • Buy 5-9 items, get a 15% discount
  • Buy 10+ items, get a 25% discount

How to Set Up Automatic Coupons in WooCommerce Based on Bulk Purchase?

  • Create the empty coupon as before.
how to set up automatic coupons in WooCommerce
  • Create a new discount rule in Disco and select the Bulk option.
bulk discount
  • Enter 2 in the Minimum and 4 in the Maximum Quantity box. Select and set the percentage value.
percentage discount
  • Click Add More twice to add 2 more rows.
add rows
  • Set the rest of the values. Keep the last Maximum field empty for unlimited counts.
bulk rule
  • Add and set the Cart Coupons condition.
add conditions
  • Save and test by adding 2 quantities of a product.
how to set up automatic coupons in WooCommerce
  • Increase the quantity to 5 or more to test the second set.
cart bulk discount
  • Finally, for 10 or more products, here’s the result.
how to set up automatic coupons in WooCommerce

Why Combine Auto-Apply Coupons with Disco?

Think of it like this: Disco is the wizard behind the curtain, silently rewarding loyal shoppers with automatic discounts. But coupon URLs? They’re the flashy billboard shouting, “Hey! Tap here for a secret deal!”

Here’s the magic combo:

  • Disco handles automatic rewards for your regulars (e.g., VIP discounts).
  • Coupon URLs from the Smart Coupon plugin create FOMO-driven urgency for promotions (e.g., “Click this link for 24-hour access to 30% off!”).

Why it works:

  • Social Proof: A “SUMMER20” link in your Instagram bio feels exclusive, like a backstage pass.
  • Trackability: See which campaigns (emails vs. TikTok) drive the most redemptions.
  • Double the Impact: Disco nurtures loyalty in the background; coupon URLs scream “Act now!” to new visitors.

Example:
Run a flash sale? Drop a time-sensitive coupon link. For everyday loyalty? Let Disco auto-reward repeat buyers. Win-win. 🚀

Wrap up

This was our step-by-step guide on how to set up automatic coupons in WooCommerce. We explored all possible ways to generate and offer auto-apply coupons, no more begging customers to copy-paste codes or missing out on hidden discounts.

With tools like Disco and Smart Coupons, you’ve got everything to turn casual clicks into loyal spenders. Start with one tactic today (cart thresholds are a crowd favorite). Tweaking as you go beats waiting for “perfect.”

Now, go launch that first campaign—your future self (and your revenue) will thank you.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top