Shopify Smart Collections: What to Know Before You Set Conditions

Shopify Smart Collections: What to Know Before You Set Conditions

If you've been on Shopify for any amount of time, you've probably set up a smart collection. You pick a condition like "Product type is equal to Shoes," hit save, and watch as Shopify automatically pulls in every shoe in your catalog. It's one of those features that saves you a ton of time once you understand how it works.

And smart collections do work well for most use cases. But like any powerful tool, there are behaviors and edge cases worth understanding before you build your entire catalog structure around them. Some of these aren't immediately obvious from the setup screen, and knowing about them upfront will save you from reworking things later. Let's walk through the ones that come up most often.

Handling Out-of-Stock Products

This is probably the most common question merchants have about collection conditions. You have a collection of, say, 200 products. Thirty of them are out of stock. You don't want to delete them because you plan to restock eventually, but you also don't want customers landing on a page full of "Sold Out" badges. The obvious move is to add a condition: Inventory stock is greater than 0. (You can find this under the inventory and price conditions when setting up your collection.)

Here's something worth knowing: inventory conditions evaluate at the variant level, not the product level. If a t-shirt has five variants and four of them are sold out but one still has stock, the product stays in the collection. That's technically correct since the product is still purchasable, but it's not always what merchants expect, especially if the remaining variant is an uncommon size.

This also creates an experience gap. The product shows up in the collection looking available, but when a customer clicks through, most of the options are grayed out. If you want tighter control over this, you can use Shopify Flow or a third-party automation tool to tag products when their total inventory drops below a certain threshold, then use that tag as a collection condition. It adds a step, but it gives you much more granular control.

Another common scenario is wanting to keep out-of-stock products visible but push them to the bottom of the collection. This makes sense for stores that want to show their full catalog (maybe to encourage back-in-stock signups) while still putting available products front and center. Shopify's built-in sort options (best selling, alphabetical, price, date) don't include inventory-based sorting, so if you want that behavior you'll need either manual sorting or a third-party app that extends the sorting options.

Excluding Vendors: Understanding the Logic

Here's a scenario that comes up all the time with multi-brand stores. You carry products from ten different vendors, and you want to create a sale collection that includes everything except products from two vendors who don't allow discounting. You set up a smart collection with the conditions "Vendor is not equal to Brand A" and "Vendor is not equal to Brand B," set it to match all conditions, and you're done.

This actually works correctly, even though the logic feels unintuitive at first. When you use "all conditions," a product must satisfy every rule. So a product from Brand C passes both checks (it's not Brand A, and it's not Brand B), and it gets included. A product from Brand A fails the first check and gets excluded. So far so good.

Where it gets tricky is the reverse: trying to create a collection that only includes products from Brand A or Brand B using "is equal to" with "all conditions." That won't work because no product can simultaneously be Brand A AND Brand B. You need to switch to "any condition," but the moment you do that, every other condition you've added (like a tag requirement or price filter) also becomes an "any" match, which can pull in products you didn't intend.

The reason for this is that Shopify uses a single matching operator for the entire collection. It's either ALL or ANY. There's no way to group conditions, like "match all of these AND any of those." Shopify's conditions reference explains how the matching logic works in detail. So if you need a collection that says "Product type is Hats AND (Vendor is Brand A OR Vendor is Brand B)," you'll need a workaround.

The simplest approach is tags. Tag the products you want with something like sale-eligible, then build the collection around that single tag. You can maintain these tags manually, or better yet, automate the tagging with Shopify Flow so it stays up to date as your catalog changes. Shopify has some worked examples of smart collections that show how to combine tag-based conditions effectively.

Watch Out for Special Characters in Tags

This one is easy to miss. Shopify treats certain special characters in tags as interchangeable. If you have a tag called red-new, Shopify considers it equivalent to red_new, red+new, and red&new when evaluating collection conditions. So if your collection has a condition of "Tag is equal to red-new," it will also match products tagged with red_new or red&new.

This is worth keeping in mind if you rely on structured tagging for a large catalog. The safe practice is to stick with letters, numbers, and hyphens, and to treat hyphens and underscores as effectively the same character when planning your tagging conventions. Shopify's tag formats documentation goes into more detail on these character rules.

Metafields as Conditions

Shopify added the ability to use metafield values as collection conditions, and this was a big step forward. Instead of relying entirely on tags, you can now create a metafield definition for something like "Material" or "Season" and use it directly as a smart collection condition. This is more structured, less error-prone, and much easier to manage than freeform tags.

There are a few things to be aware of when using this feature. First, you need to explicitly enable the "smart collections" setting on each metafield definition, since it's not on by default. You can enable it on up to 128 product metafield definitions and 128 variant metafield definitions, which is generous for most stores. Second, if you use a variant metafield as a condition, the entire product gets pulled into the collection, not just the matching variant. So if only one variant of a product has "Material: Cotton" and you build a Cotton collection, the whole product (including the non-cotton variants) shows up.

Metafield conditions work best with structured data that has known, consistent values: things like material, color codes, or boolean flags. They're less suited for free-text metafields or numeric ranges because the available condition operators vary by metafield type.

For stores that need to organize products by detailed attributes beyond what tags can handle, metafield-based collections are the way to go. Just plan your metafield definitions carefully and make sure the data is filled in consistently across your catalog. A metafield that only exists on half your products will produce a collection that looks incomplete.

For more details on setting this up, Shopify's documentation on smart collections with metafields walks through the steps.

The 60-Condition Maximum

Every smart collection can have up to 60 conditions. For most stores, that's more than enough. But if you're running a large multi-vendor operation and trying to build exclusion-based collections ("everything except these 40 vendors"), you can reach that ceiling.

The practical solution is to flip the logic. Instead of excluding 40 vendors, tag the products you want to include and use a single tag condition. It's less dynamic, but it keeps things clean and well within the condition limit.

Manual to Smart: Plan Ahead

This one isn't about conditions specifically, but it's worth knowing early on. If you create a manual collection and later decide you want it to be automated, you can't convert it directly. This is by design: Shopify treats manual and smart collections as separate types, and the type is locked once the collection is created. You'll need to create a new smart collection, set up the conditions, and then remove the old manual one.

The thing to watch here is your collection URL. If the new collection doesn't use the same handle, any links pointing to the old one (from your navigation, email campaigns, ads, or external sites) will stop working. Setting up a URL redirect from the old collection to the new one will preserve your SEO equity and keep customers from hitting a dead end.

This is a good reason to think about whether a collection should be manual or smart before you create it, especially for collections that are linked to from multiple places.


Want to get more out of your Shopify store? Pasilobus builds apps for merchants who want better analytics, smarter store management, and tools that work at scale.

ブログに戻る