How to Set Up a WooCommerce First Order Discount (With Code + Plugin)
To set up a WooCommerce first order discount, you need a pricing rule that checks whether a customer has placed any previous orders before applying the discount. Since WooCommerce does not include a built-in first-purchase discount option, you can either add custom PHP code to your theme’s functions.php file or use a discount plugin to handle the condition automatically.
This guide covers both methods: custom code for fixed-amount, percentage, and free-shipping discounts, and a plugin-based method using Disco for automatic first-order discounts without a coupon code. You will also find troubleshooting steps, restriction methods, and FAQs based on common search questions.
What Is a WooCommerce First Order Discount?
A WooCommerce first order discount is a promotional offer that applies exclusively to customers placing their first purchase in your store. It reduces the total price at checkout only for buyers with no previous completed orders on record. This type of offer is also referred to as a first purchase discount, new customer discount, first-time buyer offer, or WooCommerce sign up discount depending on how it is promoted.
| Discount Type | How It Works | Example |
|---|---|---|
| Percentage Discount | Reduces total cart value by a set percentage | 20% off for new customers |
| Fixed Cart Discount | Deducts a fixed amount from the entire order | $10 off your first order |
| Fixed Product Discount | Applies a fixed amount to selected products only | $5 off featured items |
| Free Shipping | Removes shipping costs for first-time buyers | Free shipping on first order |
| Free Gift / BOGO | Adds a free product or buy-one-get-one deal | Buy One Get One Free |
| Tiered / Conditional | Activates based on a spend threshold | Spend $100, get 15% off |
| Auto-Applied Discount | Applies automatically without a coupon code | Discount applied at checkout |
| First Order Coupon Code | Customer enters a code at checkout | WELCOME10 |
| Sign Up Discount | Applied after account registration or newsletter signup | 10% off after sign up |
How to Create a WooCommerce First Order Discount
WooCommerce does not have a built-in option to create a coupon or discount rule restricted to first-time customers only. There are two ways to achieve this:
- Method 1: Add custom PHP code to your theme’s functions.php file
- Method 2: Use a WooCommerce discount plugin for automatic, no-code setup
Both methods are covered below.
Method 1: WooCommerce First Order Discount with Custom Code
Use this method if you are comfortable editing PHP files and want a lightweight solution without installing a plugin.
Step 1: Create a Child Theme or Back Up Your Files
Before editing any theme files, create a child theme or back up your current theme files. This protects your changes from being overwritten during theme updates.
Step 2: Open the Theme File Editor
Go to your WordPress dashboard and navigate to Appearance > Theme File Editor. Open the functions.php file and scroll to the bottom. Paste your code there.

Once you are there, click on the funcitons.php, scroll down the file, and write your code at the bottom.

Step 3: Add the Fixed Amount Discount Code
The following code applies a fixed $10 discount to first-time buyers. It checks whether the logged-in user has any previous orders before applying the discount.
// Apply first order discount for new customers
function apply_first_order_discount() {
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return;
if ( is_user_logged_in() ) {
$current_user = wp_get_current_user();
$user_orders = wc_get_orders( array(
'customer' => $current_user->ID,
'limit' => 1,
) );
if ( empty( $user_orders ) ) {
add_action( 'woocommerce_cart_calculate_fees', 'add_first_order_discount' );
}
}
}
add_action( 'wp', 'apply_first_order_discount' );
function add_first_order_discount() {
$discount_amount = 10; // Set your discount amount here
WC()->cart->add_fee( __( 'First Order Discount', 'woocommerce' ), -$discount_amount );
}
Code explanation:
apply_first_order_discount: Checks if the user is logged in and has zero previous orders. If both conditions are true, it hooks the discount function towoocommerce_cart_calculate_fees.add_first_order_discount: Applies the discount as a negative fee on the cart.
Step 4: Test the Discount
Log out of your account (or use incognito mode) and create a new test customer account. Add a product to the cart and check the cart page to confirm the first order discount is applied. Make sure to clear browser cookies before testing.
Offering a Percentage Discount Instead
To offer a percentage-based discount (e.g., 10% off), replace the fixed amount logic with the following:
function apply_first_order_discount() {
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return;
if ( is_user_logged_in() ) {
$current_user = wp_get_current_user();
$user_orders = wc_get_orders( array(
'customer' => $current_user->ID,
'limit' => 1,
) );
if ( empty( $user_orders ) ) {
add_action( 'woocommerce_cart_calculate_fees', 'add_first_order_discount' );
}
}
}
add_action( 'wp', 'apply_first_order_discount' );
function add_first_order_discount( $cart ) {
$discount_percentage = 0.10; // 10% discount
$discount_amount = $cart->subtotal * $discount_percentage;
WC()->cart->add_fee( __( 'First Order Discount', 'woocommerce' ), -$discount_amount );
}

Change 0.10 to your preferred percentage (e.g., 0.20 for 20%).
Offering Free Shipping on the First Order
To offer free shipping instead of a cart discount, use the following code. It adds a free shipping option to the checkout for users placing their first order.
function apply_free_shipping_for_first_time_buyers() {
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return;
if ( is_user_logged_in() ) {
$current_user = wp_get_current_user();
$user_orders = wc_get_orders( array(
'customer' => $current_user->ID,
'limit' => 1,
) );
if ( empty( $user_orders ) ) {
add_filter( 'woocommerce_package_rates', 'add_free_shipping_for_first_order', 10, 2 );
}
}
}
add_action( 'wp', 'apply_free_shipping_for_first_time_buyers' );
function add_free_shipping_for_first_order( $rates, $package ) {
$free_shipping_rate = new WC_Shipping_Rate(
'free_first_order_shipping',
__( 'Free Shipping (First Order)', 'woocommerce' ),
0,
array(),
'free_shipping'
);
$rates['free_first_order_shipping'] = $free_shipping_rate;
return $rates;
}
To remove all other shipping options and only display free shipping for new customers, uncomment the return array(...) line and remove the standard return $rates line.
Method 2: Automatically Apply First Order Discounts Using Plugin
The easiest way to create a WooCommerce first-order discount is by using a discount plugin. For this method, we will use the Disco WooCommerce Dynamic Pricing & Discount Rules Plugin.
Using Disco, you can create an automatic WooCommerce first purchase discount without sharing any coupon code with customers. The discount will be applied automatically when the customer meets the first-order condition.
This method works for any WooCommerce store and is useful when you want to offer:
- Fixed amount WooCommerce first order discount
- Percentage WooCommerce first order discount
- Product-based first purchase discount
- Store-wide first order discount
- WooCommerce discount for first-time customers
- Automatic discount without coupon code
Let’s create a 20% WooCommerce first order discount using Disco.
Step 1: Go to Disco from Your WordPress Dashboard
After installing and activating the Disco plugin, go to your WordPress dashboard.
From the admin sidebar, navigate to:
Disco → Create a discount. This will take you to the discount campaign creation page.

Step 2: Add a Campaign Name and Select Your Discount Intent
Give the campaign a descriptive internal name (e.g., 20% off first order) and set the discount intent to Product-based discount. This name is for your reference only and will not be visible to customers.

Step 3: Set the Product Filter to “All Products”
Now, select your product filter.
Choose:
All products
This will apply the first order discount store-wide.

If you don’t want to offer the discount on every product, you can also narrow it down to specific products or product categories.
For example, you can apply the WooCommerce first purchase discount only to:
- Selected products
- Specific categories
- Featured items
- New arrivals
- Seasonal collections
But for this example, we will keep it simple and apply the discount to all products.
Step 4: Set a User Limit and Validity Date
Next, set a user limit and validity date for the discount campaign.
For example:
User limit: 100
This means only 100 eligible first-time customers can use the discount.

You can also set a validity date to control when the offer starts and ends. This helps you avoid keeping the campaign open forever.
This is useful for:
- Limited-time first order offers
- Holiday campaigns
- New customer acquisition campaigns
- Seasonal promotions
- Welcome discount campaigns
Step 5: Choose Your Discount Type and Value
Select Percentage discount and enter your discount value (e.g., 20 for 20% off). You can alternatively choose a fixed amount or free shipping here.

This will create a 20% discount for first-time customers.
You can also choose other discount types depending on your campaign goal, such as:
- Fixed discount
- Percentage discount
- Free shipping
- Product discount
For example, instead of 20% off, you can offer:
- $10 off first order
- 15% off first purchase
- Free shipping on first order
- $5 off selected products
Step 6: Set the Condition: “Is First Order = Yes”
This is the most important step.
Under the Conditions section, add the following rule:
Is First Order → Equal → Yes

This condition ensures the discount applies only to first-time customers.
That means the discount will be available only when the customer has no previous orders in your WooCommerce store. Returning customers will not receive this discount.
This is what makes it a true WooCommerce first order discount instead of a general discount campaign.
Step 7: Save and Activate Your First Order Discount
After configuring the discount rule, click:
Save. Your campaign is now live.

Any new customer placing their first order will automatically receive the discount. They don’t need to enter a coupon code manually.

As you can see, when the customer has no previous purchases, the discount is automatically applied to eligible products.
If the condition is set to Is First Order = Yes, Disco checks whether the customer is placing their first order and applies the discount automatically at checkout.
Returning customers are excluded without any manual work on your end.
This makes Disco a simple and effective WooCommerce first order discount plugin for creating automatic first purchase discounts, new customer discounts, and first-time buyer offers.
How to Restrict WooCommerce Discounts to First-Time Buyers Only
To prevent returning customers from claiming first-order discounts, use one or more of the following restriction methods.
1. Restriction by User Role
Limit coupon eligibility to the “Customer” role while excluding “Subscriber,” “Contributor,” or other roles. This is most effective for stores with membership tiers or wholesale programs.
2. Validation by Order History
WooCommerce can check a customer’s past transactions linked to their account or billing email. The system scans for orders with a “Completed” or “Processing” status. If the count is zero, the discount applies. This also prevents existing customers from using a new-customer code if they use their primary billing email.
3. Guest Customer Validation
For shoppers who check out as guests, systems can validate using the billing email, phone number, or IP address to prevent the same user from claiming multiple first-order discounts across different sessions.
Troubleshooting WooCommerce First-Order Discounts
Discount Applies to Returning Customers
This happens when the system only checks coupon usage count instead of verifying actual order history.
Fix: Configure validation using billing email or customer account order history. Check for previous orders with “Completed” or “Processing” status before applying the discount.
Guest Users Bypassing Restrictions
Some users attempt to reuse new-customer discounts by checking out as guests with different email addresses.
Fix: Require account creation before the discount applies. Use IP or device-based tracking or phone/SMS verification to limit one discount per unique user.
Discount Fails to Appear at Checkout
The discount may not trigger due to unmet conditions or plugin/theme conflicts.
Fix: Review coupon rules (minimum spend, product restrictions, expiry dates) in the Usage Restrictions settings. Disable caching on cart and checkout pages. Test with a default theme such as Storefront to isolate theme or custom code conflicts.
Best WooCommerce First Order Discount Plugin: Disco
Disco – WooCommerce Dynamic Pricing & Discount Rules is a WooCommerce discount plugin designed for creating automatic pricing rules and conditional discount campaigns.
Using the “Is First Order” condition, Disco applies a discount automatically to new customers without requiring a coupon code. It supports percentage discounts, fixed amounts, free shipping, and product-level discounts.
Key Features
- Automatic discount application without a coupon code
- “Is First Order” condition for targeting new customers only
- Percentage, fixed amount, and free shipping discount types
- User limit and validity date controls per campaign
- Product-level, category-level, or store-wide discount targeting
- Compatible with standard WooCommerce checkout flow
Check the official Disco plugin page for current pricing and free plan availability.
Frequently Asked Questions
How do I create a first-order discount in WooCommerce?
Navigate to Marketing > Coupons in your WordPress dashboard to create a manual coupon. For an automatic first-order discount that applies without a code, use a plugin like Disco and set the condition to “Is First Order = Yes.” The plugin checks the customer’s order history and applies the discount only when no previous orders exist.
Can WooCommerce detect first-time customers?
WooCommerce tracks customer emails and linked accounts to determine order history. By default, it can detect whether a logged-in customer has previous orders. For more reliable detection that also covers guest checkouts, use a plugin or custom validation that checks the billing email and phone number against completed and processing orders in the database.
How do I offer free shipping on the first order in WooCommerce?
You can use two methods. The coupon method involves creating a coupon with the “Allow free shipping” option checked and enabling free shipping in your Shipping Zones settings. The automatic method uses custom code or a conditional shipping plugin to apply a $0.00 shipping rate when the system detects the customer’s first transaction.
What is the best first purchase discount percentage for WooCommerce?
This depends on your product margins and industry. A 10% discount is common but may not be compelling enough in competitive niches. Offers in the 20% to 30% range tend to convert better for first-time buyers, particularly in fashion, home decor, and beauty categories. Test different values and measure conversion rates before settling on a permanent offer.
What is the difference between a first-order coupon code and an automatic first-order discount?
A first-order coupon code requires the customer to enter a code at checkout (e.g., WELCOME10). An automatic first-order discount applies without any code, triggered by a condition check (usually “Is First Order = Yes”). Automatic discounts typically see higher redemption rates because there is no friction at checkout.
How do I add a WooCommerce sign up discount?
A WooCommerce sign up discount is a first-order offer given after a customer registers for an account or subscribes to a newsletter. You can set this up by triggering a coupon email after account creation using a plugin or by using Disco with the “Is First Order” condition combined with a registered user requirement.
Key Takeaways
- WooCommerce does not include a native first-order discount option; you need custom code or a plugin.
- Custom PHP code using
woocommerce_cart_calculate_feescan apply fixed, percentage, or free shipping discounts to logged-in first-time buyers. - The Disco plugin lets you create automatic first purchase discounts using the “Is First Order = Yes” condition with no coupon code required.
- Restrict first-order discounts to new customers by validating order history via billing email, account ID, or a dedicated plugin condition.
- For guest checkout abuse prevention, use billing email or phone number validation in addition to account-based checks.
- First-order discounts work best when combined with email capture, so you can follow up with returning customer campaigns.
- Test discounts in a new incognito session with a fresh account before publishing any code-based changes.
