Blog

How to Give New Customers a First Order Discount in WooCommerce

WooCommerce first order discount: the WELCOME10 coupon refused for a returning customer and applied to a new customer's first order

You want a welcome offer, say 10% off, that new customers get on their first order and that your regulars can’t use. WooCommerce has no first order discount setting, so the coupon on its own can’t tell a new customer from one who has ordered 20 times.

The short answer: create a normal coupon, then add a check that refuses it when the customer already has an order, looked up by their account and by their billing email. You can add that check with a short snippet, with a “First order only” coupon rule from a plugin, or with an automatic discount rule that needs no code at all.

We set up all three in a test store (WooCommerce 11.2.1, the Larch Home demo shop) and recorded who got the discount: a returning customer, a brand-new account, guests with old and new email addresses, and which order statuses count. This post shows the results, the setup for each option and the loophole none of them closes.

Does WooCommerce have a first order discount setting?

No. The coupon screen in Marketing > Coupons has 3 limits that sound close, and none of them looks at earlier orders (they are described in WooCommerce’s coupon management docs):

  • Usage limit per user counts how often a customer has used this coupon. Set it to 1 and every customer, old or new, can still use it once.
  • Usage limit per coupon caps the total uses across all customers.
  • Allowed emails limits the coupon to addresses you list. Useful for a coupon you send to one person, useless for a public welcome code.

Many store owners set “Usage limit per user” to 1 and stop there. We tested it: Maya, a Larch Home customer with 4 earlier orders, applied a 10% coupon with that limit and got $1.20 off a $12 jar.

Cart totals of a customer with 4 earlier orders showing coupon hello10 accepted with a $1.20 discount
Maya has 4 earlier orders. WooCommerce still accepts a coupon set to “Usage limit per user: 1”.

The limit did its own job (Maya can’t use that code twice), but it never asked whether she had bought before. In WooCommerce’s code, the per-user limit counts the coupon’s uses by account, and for guests by billing email at checkout. Nothing in WooCommerce counts a customer’s earlier orders when a coupon is applied, so a real first order discount needs one extra check.

How a store can tell an order is someone’s first

A good first order check makes 2 checks, and how well it does them decides who slips through. The snippet in Option 1 and the coupon rule in Option 2 make both; the automatic rule in Option 3 works a little differently, as its section explains.

  1. By account. If the shopper is signed in, look for earlier orders on their customer account. This catches a regular who types a different billing email at checkout: in our test, Maya, signed in and typing a new billing email, was still refused.
  2. By billing email. Look for earlier orders placed with the same billing email, account or not. This is the only way to recognize returning guests, and it also catches someone who checked out as a guest last time and has just created an account.

Two details matter. First, a guest has no email until they type it at checkout, so a guest’s coupon is always accepted in the cart and can only be refused at checkout. Second, “earlier order” needs a definition. The snippet and the URL Coupons rule count orders that are on hold, processing or completed. Pending, failed, cancelled and refunded orders don’t count, so a shopper whose first order was cancelled or fully refunded is treated as new again.

Diagram of the first order check made by the snippet and the URL Coupons rule: earlier orders on the account, then earlier orders with the billing email, and which order statuses count

On hold matters for stores that take bank transfers or checks, because those orders wait on hold until you mark them paid. In our test, a second order with the same email was refused the coupon while the first bank transfer order was still unpaid. A check that only counts paid orders would have given the discount twice. Email matching ignored capital letters in our test: [email protected] was recognized as [email protected].

Option 1: a coupon plus a snippet

If you only need one welcome coupon and you are comfortable adding code, a short snippet does both checks. Create the coupon first in Marketing > Coupons > Add coupon (here WELCOME10, a 10% percentage discount), then add this with a code snippets plugin or in your child theme’s functions.php:

// Coupon WELCOME10 only works for customers without an earlier order (by account and billing email).
add_filter( 'woocommerce_coupon_is_valid', function ( $valid, $coupon, $discounts = null ) {
	if ( ! $valid || 'welcome10' !== $coupon->get_code() ) {
		return $valid;
	}
	$order = $discounts ? $discounts->get_object() : null;
	$user  = $order instanceof WC_Order ? $order->get_customer_id() : get_current_user_id();
	$email = $order instanceof WC_Order ? $order->get_billing_email() : ( WC()->customer ? WC()->customer->get_billing_email() : '' );
	$args  = array( 'limit' => 1, 'return' => 'ids', 'status' => array( 'on-hold', 'processing', 'completed' ) );

	if ( ( $user && wc_get_orders( $args + array( 'customer_id' => $user ) ) )
		|| ( $email && wc_get_orders( $args + array( 'billing_email' => $email ) ) ) ) {
		throw new Exception( 'This coupon is for first orders only.' );
	}
	return $valid;
}, 10, 3 );

Write the code in lowercase: WooCommerce lowercases every coupon code before it checks it. In our tests the snippet refused Maya in the cart with “This coupon is for first orders only.”, accepted a new account, and took the coupon off a guest’s order in the Checkout block as soon as they typed a returning customer’s email.

What it doesn’t do: it doesn’t apply the coupon for the customer or show it anywhere, so new customers still need to know the code. In the classic (shortcode) checkout, the guest check only happens when they click Place order, and WooCommerce replaces the message with its generic “Sorry, it seems the coupon “welcome10″ is invalid – it has now been removed from your order.” Each extra coupon needs its own copy of the code, which someone has to maintain.

Option 2: a first order coupon with URL Coupons & Coupon Rules

URL Coupons & Coupon Rules adds a “First order only” rule to WooCommerce’s own coupon screen, checked by account and by billing email, plus options to apply the coupon automatically or list it for the customers who can use it. It is our plugin, and we used it for most tests in this post.

URL Coupons & Coupon Rules in 20 seconds.

To set up a WooCommerce coupon for the first order only:

  1. Go to Marketing > Coupons and add a coupon, or open the welcome coupon you already have.
  2. In the General tab, set the discount type and amount (Percentage discount, 10).
  3. Open the Usage restriction tab and tick First order only.
  4. Add any other limits you want, such as a Minimum spend, and click Publish.
First order only ticked in the Usage restriction tab of a WooCommerce coupon

The rule is checked wherever WooCommerce checks coupons: in the cart, at checkout and on orders you create in wp-admin. It counts on hold, processing and completed orders, the same as the snippet above. The URL Coupons & Coupon Rules docs cover the other rules on the same tab, such as allowed roles and days of the week.

Let the coupon apply itself, or list it in the cart

A first time order discount only works if new customers know about it. Two checkboxes in the coupon’s General tab take care of that:

Apply automatically and Show to customers ticked in the General tab of the WELCOME10 coupon
  1. Apply automatically adds the coupon to every cart that meets its rules, without a code. Combined with First order only, a new customer gets the discount and a returning customer who is signed in never sees it. If a customer takes it out, it stays out for the rest of their visit.
  2. Show to customers lists the coupon under “Coupons you can use” in the cart, at checkout and in a Coupons tab in My Account, with an Apply button. In our test it was listed for guests and for Noah, a new account, but not for Maya.

This is what Noah, signed in with no earlier orders, saw after adding a $12 jar to his cart with Apply automatically on:

WooCommerce cart of a new customer with the first order discount WELCOME10 applied automatically and a notice saying 10% off was added

What returning customers and guests see

When Maya, signed in, typed WELCOME10 into the Cart block, it was refused with “This coupon is for first orders only.” Guests are checked at checkout: we applied WELCOME10 as a guest, went to the Checkout block and typed Maya’s email. The coupon came off the moment the email field lost focus, and the total went back to $18.95:

WooCommerce Checkout block removing the welcome10 coupon because the guest's email has an earlier order
A guest types the email of a returning customer: the coupon comes off before they pay.

Two differences we noticed. A coupon that was applied automatically is taken off quietly: the discount line disappears, with no message. And in the classic checkout, the coupon stays visible until the customer clicks Place order, then it is removed with WooCommerce’s generic “invalid coupon” notice and the order waits so they can review the new total. Either way, the order can’t go through with the discount.

That quiet removal is the downside of Apply automatically: a returning guest sees “Good news: 10% off was added to your cart”, then loses the discount at checkout without a word. If many regulars check out as guests, ticking only Show to customers may be clearer, because a refused code comes with a reason.

Option 3: an automatic first purchase discount rule

If you would rather not use a coupon at all, a discount rules plugin can give the first purchase discount as a rule. In our Dynamic Pricing & Discount Rules plugin, that is an Order discount rule with Earlier orders set to First order only. There is no code to share or post on coupon sites: eligible customers simply see the discount, added to the order as a line with the name you set under “Name customers see” (here “First order”). This is the welcome rule from our demo store, 5% off a first order:

Dynamic Pricing and Discount Rules order discount rule with Earlier orders set to First order only
The help text under the field says which orders it counts.

Its check differs from the coupon rule. We read the code and checked it in the lab: it counts paid orders only (processing and completed, not on hold), and it checks signed-in customers by account only. So a bank transfer customer whose first order is still on hold gets the discount again. So does a customer who ordered as a guest and later created an account with the same email, until they verify that email (for example by setting a password through the link WooCommerce emails them): only then does WooCommerce 11 link their guest orders to the account. Guests are checked by the email they enter at checkout. If payments sit on hold in your store, the coupon rule from Option 2 is stricter.

Which first order discount should you use?

Here is how the options compared in our tests, next to WooCommerce on its own:

WooCommerce aloneCoupon + snippetURL Coupons ruleDynamic Pricing rule
Refuses customers with earlier ordersNoYesYesYes
Checks signed-in customers byNothingAccount and billing emailAccount and billing emailAccount
Checks guests byNothingBilling email at checkoutBilling email at checkoutBilling email at checkout
Earlier orders that countNoneOn hold, processing, completedOn hold, processing, completedProcessing, completed
Works without a codeNoNoYes (Apply automatically)Yes (no coupon)
Shown to new customersNoNoYes (Show to customers)As a discount line
Stops a new or aliased emailNoNoNoNo

In short: the snippet is fine for one coupon that you hand out yourself. A coupon with a First order only rule suits most stores, because the same welcome code works in emails, ads and pop-ups and can also apply itself. An automatic rule suits stores that don’t want a code at all and take card payments, where orders don’t wait on hold. Our posts on BOGO offers and quantity discounts show how discount rules behave in the cart.

Free plugins on WordPress.org also add a first order coupon or discount, and one may be enough for a small store. Whichever you try, check 2 things with a test order: are guests checked by billing email, and which order statuses count (on hold matters for bank transfers and checks).

The new email loophole (and what you can do about it)

Every check above stops at the email address. When we checked out as a guest with [email protected], a “plus” alias that delivers to Maya’s normal inbox, the order went through with 10% off. A brand-new address works the same way, and so does a new account. No option we tested links two addresses to one person.

WooCommerce order placed by a guest with the alias email maya.patel+1@example.com and the welcome10 coupon applied
The alias order in WooCommerce > Orders: a guest, [email protected], and welcome10 taking $1.20 off.

You can’t close this completely, but you can make it less worth the effort:

  • Keep the offer modest and set a Minimum spend in the coupon’s Usage restriction tab, so the discount only pays off on a real order. Ticking Individual use only stops it from being stacked with other coupons.
  • Hand the code out privately, for example in a welcome email: public codes end up on coupon sites. Our Marketing Automation Workflows plugin can send new account holders a welcome email with a personal, single-use coupon that expires. That keeps the code off coupon sites, but it doesn’t stop new accounts: every new account gets one, alias accounts included.
  • Look at the orders that used the code now and then. Searching for the code in WooCommerce > Orders lists them (it did in our test store), and the same shipping address on several “first” orders is easy to spot.

Keep the loss in proportion: a customer who makes up an address to save $1.20 on a $12 jar still pays for the order, and blocking them harder usually costs more in support time than the discount.

FAQ

Can a first order discount apply automatically without a code?

Not with WooCommerce alone. With URL Coupons & Coupon Rules, tick “Apply automatically” next to “First order only” and the coupon is added to every cart that qualifies. An automatic discount rule, such as the one in Option 3, has no code in the first place.

Does a first order coupon work with guest checkout?

Yes, as long as the check includes the billing email. A guest’s coupon is accepted in the cart, then checked when they enter their email at checkout. In our tests the coupon came off right away in the Checkout block, and at Place order in the classic checkout.

Can I give free shipping on the first order instead?

Yes. Tick “Allow free shipping” on the coupon, add a Free shipping method to your shipping zone that requires a valid free shipping coupon, and tick First order only on the same coupon. The first order rule works the same with any discount type.

What if a customer’s first order was cancelled or refunded?

With the snippet and the URL Coupons rule, a cancelled, failed, pending or refunded order doesn’t count, so that customer can use the welcome coupon again. That is usually fair, since they never kept a discounted order. If you want refunded orders to count, add ‘refunded’ to the statuses in the snippet.

Do customers who signed up but never ordered still count as new?

Yes. Every check here looks for orders, not for accounts, so an account with no orders gets the first order discount.

Set up your welcome offer

Don’t rely on “Usage limit per user” alone: it counts uses of this coupon, not earlier orders. For a single code you share yourself, the snippet above is enough. For a welcome code that applies itself, is listed only for customers who can use it (guests see it until their email shows an earlier order) and leaves you no code to maintain, add a First order only rule with URL Coupons & Coupon Rules, try it first with “Try live demo” on the product page, and test it once with an email that has an earlier order before you announce the offer. If something behaves differently, open a support ticket.

14-day money-back guarantee

Try it on your store, risk-free

Every plugin includes ongoing updates and support. If it isn’t right for your store, get a full refund within 14 days, no questions asked.