"Sorry, No Products Matched Your Selection": Why a Real Combination Fails
The variation form found no published, priced variation for the options the shopper picked. On products with more than 30 variations the dropdowns stop filtering, so shoppers can pick combinations that were never created.
WooCommerce shows "Sorry, no products matched your selection. Please choose a different combination." when the options a shopper picked do not lead to any variation it is allowed to sell. The message is printed by the variation script on the product page, not by PHP. It means that the lookup for the chosen attributes came back empty: the combination was never created, the variation that should match it is disabled or has no price, or its stored attribute values no longer match the product's attributes.
Two messages, two problems
The same form can show two similar notices, and telling them apart halves the search:
| Notice | What the script found | Usual cause |
|---|---|---|
| Sorry, no products matched your selection. Please choose a different combination. | No variation for these options | Combination not created, variation disabled, attribute value changed |
| Sorry, this product is unavailable. Please choose a different combination. | A variation that is not visible | Variation published without a price (products above the threshold) |
Visibility is variation_is_visible(): the variation must be published (the Enabled box in its panel) and have a price that is not empty. Out-of-stock variations are a third case. They are still found and shown with an out-of-stock notice, unless Hide out of stock items from the catalog is enabled in Products › Inventory. With that setting on, an out-of-stock variation drops out of the list on small products and the shopper gets the "no products matched" message instead.
The 30-variation switch
How the form finds a variation depends on the size of the product. WooCommerce counts the product's children and compares them with the woocommerce_ajax_variation_threshold filter, which defaults to 30:
- Up to 30 variations. All available variations are embedded in the form's
data-product_variationsattribute. The script matches locally, and it removes options from the other dropdowns that cannot lead to an available variation. Shoppers rarely reach the message. - More than 30. The attribute is set to
false, and each complete selection is sent to theget_variationAJAX endpoint. The dropdowns are not filtered, so every size is selectable with every colour, and an uncreated combination is reported only after the shopper has chosen it.
This is the trap behind most reports: a product works perfectly at 24 variations, the shop adds a sixth colour, the count crosses 30, and the message starts appearing on combinations that never existed. Nothing broke. The safety net was simply removed.
If you want to keep the filtering on a slightly larger product, raise the threshold:
add_filter( 'woocommerce_ajax_variation_threshold', function ( $threshold, $product ) {
return 60;
}, 10, 2 );
Every variation's data is then printed into the page, so treat this as a fix for dozens of variations, not hundreds.
Cause 1: the combination does not exist
Open the product's Variations tab and look for the exact pair the shopper chose. Variations are only created for combinations you added. Generate variations creates every combination of the attributes ticked Used for variations, but variations added one by one leave gaps. The setup order is covered in how to add product variations.
If an attribute never affects the price or stock, set it to Any on the variation instead of creating one per value. A variation with "Any Colour" matches every colour.
Cause 2: the variation is disabled or has no price
The AJAX lookup only searches variations with the publish status, so an unticked Enabled box makes the combination disappear for products above the threshold. Below it, a variation without a price is left out of the embedded list. Above it, a published variation without a price is still found, and the shopper sees "this product is unavailable" instead. Bulk edits and CSV imports are the usual source: an import that maps the regular price column wrongly creates variations with empty prices, and the store front reports them as missing.
Cause 3: the attribute value changed after the variation was made
Each variation stores the value it was created for, as the term slug for a global attribute or the literal text for a custom one. Edit the text of a custom attribute on the product ("XL" to "X-Large"), and the existing variations keep the old value. The dropdown now offers a value no variation has, and every selection that includes it fails.
Global attributes are safer: when you change a term's slug in Products › Attributes, WooCommerce rewrites the stored value on every variation. Slugs changed by a database edit or import, or a term deleted and recreated, get no such update. Open each affected variation, re-select the value in its dropdown and save.
Cause 4: the script is fighting another script
When the message appears for combinations that clearly exist, check the browser console. Swatch plugins, quick-view pop-ups and themes that rebuild the dropdowns can post attribute names in the wrong format. Performance plugins that delay or combine JavaScript can also run add-to-cart-variation.js before its parameters are printed. A console error such as jQuery is not defined usually points straight at the cause. Exclude the variation scripts from delay and combination in your cache plugin and test again.
Common mistakes
- Generating all variations to make the message go away. On a product with 8 sizes, 12 colours and 3 materials that creates 288 variations, most of them never stocked, and a slow admin.
- Leaving default form values that point at a missing combination. If the defaults name a combination that does not exist, the page opens with options selected but no price and a disabled button. Pick defaults that match a real variation.
- Testing only small products. Check one product above 30 variations whenever you change swatches, themes or script optimisation.
Verify
- On an affected product, count the variations. If there are more than 30, expect unfiltered dropdowns.
- Select the failing combination with the browser's Network tab open. The
wc-ajax=get_variationresponse should be a variation object, notfalse. - If it is
false, find the variation in the admin and confirm it is enabled, has a price and uses the current attribute values. - Clear any page cache and repeat in a private window. A cached product page can carry variation data from before your fix.
Frequently asked
- "No products matched your selection" means no variation fits the chosen options at all. "Sorry, this product is unavailable. Please choose a different combination." means a variation was found but cannot be sold as shown, almost always because it is published without a price. It appears on products above the 30-variation threshold; below it, an unpriced variation is left out and you get the first message. The first is a missing variation, the second a broken one.
- Products with up to 30 variations send every variation to the browser, which removes impossible options before the shopper picks them. Above 30, WooCommerce looks each combination up with an AJAX request after the choice, so every option stays selectable and the message is the first feedback a shopper gets.
- Only modestly. Raising it puts every variation's data, including prices, images and stock, into the product page HTML. For 50 or 80 variations that is usually fine; for several hundred it makes the page heavy. Creating the missing combinations, or using Any for an attribute that does not change the price, fixes the cause instead.