Skip to content

WordPress WooCommerce coupon code conflicts — stacking, exclusions, and audit

WordPress WooCommerce coupons interact in subtle ways under stacking, exclusion lists, and per-customer limits. The audit that finds the discounted-to-zero order before it ships.

A WordPress WooCommerce store runs a 25 percent off campaign and a separate free-shipping coupon. A customer applies both, plus the still-valid 20 percent off from last quarter the operator forgot to expire, plus an automatic 10 percent for VIP members. The cart total drops to $4.20. The order ships, the operator notices three weeks later when reconciling marketing spend. Coupons in WooCommerce stack by default and the exclusion logic is more nuanced than the UI suggests.

What’s happening

WooCommerce coupons (shop_coupon post type) carry these properties:

  1. Discount type. Percent, fixed cart, fixed product, free shipping (and any custom types from plugins like Smart Coupons).
  2. Amount, expiry, minimum spend, maximum spend.
  3. Allow free shipping. Whether the coupon also unlocks free-shipping methods.
  4. Individual use only. If checked, the coupon cannot stack with any other coupon. By default, this is unchecked — coupons stack.
  5. Exclude sale items, product / category exclusions and inclusions.
  6. Usage limit per coupon and per customer.

The “Individual use only” checkbox is the single most consequential setting and the most commonly missed.

Five common conflict patterns:

  • Expired coupons still working. Coupon expiry date is in the past but the coupon was reactivated by accident, or the coupon has no expiry and was assumed to be one-time-use.
  • Stacking when nobody planned for it. Two coupons exist with “Individual use only” unchecked. Customer applies both.
  • VIP / wholesale role auto-discounts plus coupon. Plugins like Wholesale Suite apply a role-based discount automatically. Combined with a normal coupon, the cart can go negative.
  • Free shipping coupon on a “free shipping requires coupon” zone. Free shipping is configured in the shipping zone to require any coupon; any coupon entered triggers free shipping.
  • Per-customer limit bypass. “Limit per customer” relies on customer email. Customer uses a different email per checkout, gets the discount again.

How to verify

# All active coupons with their stacking flag
wp db query "SELECT p.ID, p.post_title, pm_type.meta_value AS discount_type,
  pm_amount.meta_value AS amount, pm_expiry.meta_value AS expiry,
  pm_individual.meta_value AS individual_use
  FROM wp_posts p
  LEFT JOIN wp_postmeta pm_type ON p.ID=pm_type.post_id AND pm_type.meta_key='discount_type'
  LEFT JOIN wp_postmeta pm_amount ON p.ID=pm_amount.post_id AND pm_amount.meta_key='coupon_amount'
  LEFT JOIN wp_postmeta pm_expiry ON p.ID=pm_expiry.post_id AND pm_expiry.meta_key='date_expires'
  LEFT JOIN wp_postmeta pm_individual ON p.ID=pm_individual.post_id AND pm_individual.meta_key='individual_use'
  WHERE p.post_type='shop_coupon' AND p.post_status='publish'
  ORDER BY pm_expiry.meta_value DESC"

# Coupons that have NEVER had individual_use set
wp db query "SELECT p.ID, p.post_title FROM wp_posts p
  LEFT JOIN wp_postmeta pm ON p.ID=pm.post_id AND pm.meta_key='individual_use'
  WHERE p.post_type='shop_coupon' AND (pm.meta_value IS NULL OR pm.meta_value='no')"

# Recent orders with multiple coupons applied
wp db query "SELECT p.ID, p.post_date, pm.meta_value AS coupons_used, pm_total.meta_value AS total
  FROM wp_posts p
  JOIN wp_postmeta pm ON p.ID=pm.post_id AND pm.meta_key='_used_coupons'
  JOIN wp_postmeta pm_total ON p.ID=pm_total.post_id AND pm_total.meta_key='_order_total'
  WHERE p.post_type='shop_order'
    AND pm.meta_value LIKE '%,%'  -- contains comma = multiple coupons
    AND p.post_date > NOW() - INTERVAL 30 DAY
  ORDER BY p.post_date DESC LIMIT 30"

# Coupons used per coupon over the last 90 days
wp db query "SELECT order_item_name, COUNT(*) AS uses
  FROM wp_woocommerce_order_items
  WHERE order_item_type='coupon'
  GROUP BY order_item_name
  ORDER BY uses DESC LIMIT 30"

# Orders where the discount exceeded the subtotal (a red flag)
wp db query "SELECT p.ID, pm_subtotal.meta_value AS subtotal, pm_discount.meta_value AS discount, pm_total.meta_value AS total
  FROM wp_posts p
  JOIN wp_postmeta pm_subtotal ON p.ID=pm_subtotal.post_id AND pm_subtotal.meta_key='_cart_discount'
  JOIN wp_postmeta pm_discount ON p.ID=pm_discount.post_id AND pm_discount.meta_key='_cart_discount'
  JOIN wp_postmeta pm_total ON p.ID=pm_total.post_id AND pm_total.meta_key='_order_total'
  WHERE p.post_type='shop_order'
    AND CAST(pm_total.meta_value AS DECIMAL(10,2)) < 5  -- ridiculously low
    AND p.post_date > NOW() - INTERVAL 90 DAY"

The last query finds the discounted-to-zero orders. If any results come back, the coupon stack let someone walk away with merchandise effectively free.

The fix

  1. Set “Individual use only” on every coupon by default. Make it the convention. Stacking is the exception, not the default. To force the default in code:
    add_action('save_post_shop_coupon', function ($post_id) {
      if (get_post_meta($post_id, 'individual_use', true) === '') {
        update_post_meta($post_id, 'individual_use', 'yes');
      }
    });
  2. Expire old campaigns by setting an actual expiry date. Do not just disable the coupon — set date_expires to a past date. Disabling is reversible by accident; expiring is not.
  3. Audit role-based discount plugins for double-application. If Wholesale Suite or similar is applying a discount, confirm coupon usage during a wholesale customer’s checkout shows the combined discount as intended.
  4. Untangle the “free shipping requires coupon” trap. WooCommerce → Shipping zones → Free shipping → “Free shipping requires…” set to “A valid free shipping coupon.” Then only coupons with the free_shipping=yes meta unlock it.
  5. Cap per-customer limit by registered customer ID, not email. WooCommerce checks the customer email by default. Plugins like “WooCommerce Coupon Limit Per User” key off the user ID and IP combo. For a hardened posture, require account creation before discount application.
  6. Run a weekly audit query for discounted-to-zero orders. A 5-line cron that runs the last SQL query above and emails the operator if any rows return. Cheap, catches a costly failure mode.

For the broader operations posture, pair with enterprise WordPress hosting and the reporting-accuracy article in this set.


Stack Harbor audits WordPress WooCommerce coupon configurations as part of enterprise WordPress hosting onboarding — the stacking posture, the expiry hygiene, and the discounted-to-zero detection. If a customer walked away with a free order last quarter, we can find why and prevent the next one.