Want to keep selected products out of view without removing them from your Shopify store? Shopify hide products by tag Liquid is a simple way to control which items appear in storefront collections and product listings. Add a tag to the products you want to hide, then use a small Liquid condition to filter them out.
In this guide, you’ll learn how the approach works and where to add the code. It’s a practical option for organizing seasonal, exclusive, or draft-like products while keeping your catalog easy to manage. Keep in mind that hiding a product in your theme doesn’t make it private or prevent access through a direct link.
Shopify hide products by tag Liquid: How the filtering works
Once you’ve chosen which items should stay out of sight, the next step is deciding exactly where that rule applies. A tag-based condition works like a storefront display filter: it tells your theme when to skip rendering a product, while leaving the product record in your Shopify admin.
Choose a tag and decide where products should disappear
Start with a clear, consistent tag, such as hidefromstorefront. Add it only to products you want excluded, and avoid using it for unrelated catalog tasks. A distinctive tag makes the rule easier to recognize and reduces the chance that a routine tag will hide products unintentionally.
Next, identify the places where customers should no longer see those items. You might want to remove them from collection pages but keep them in a staff-facing list, or filter them from both collections and search results. Each storefront listing may use a different theme loop, so filtering one area does not automatically cover every other area.
Shopify hide products by tag Liquid in collection and search loops
With the tag selected, find the Liquid loop that renders products in your collection template or product-card snippet. The same condition can be added to a search-results loop, where the product object is also available. Wrap the existing product-card markup so it renders only when the tag is absent:
{% unless product.tags contains 'hidefromstorefront' %}
{% endunless %}
Keep the existing card code inside the condition, rather than replacing it. Test a tagged and an untagged product in each relevant view, and check both desktop and mobile layouts. If your theme uses a shared snippet, filtering there may affect several listings; confirm the result before publishing. This is the practical core of Shopify hide products by tag Liquid.
Even a tidy theme filter has boundaries. It changes what the storefront template displays; it does not change the product’s publication status or access permissions.
Understand the limits of hiding products with Liquid
A product hidden from a collection or search loop may still be reachable by someone with its direct URL. It can also remain available through other channels or integrations, depending on your setup. So this method is useful for visual merchandising, not for protecting confidential products or enforcing restricted access.
If an item must not be purchasable or publicly accessible, review its sales-channel availability and consider an access-control solution appropriate to your needs. Think of Liquid as a storefront curtain, not a locked door.
Add the Liquid code to your theme
The rule is ready; now it needs to sit in the right place in your theme. A careful edit lets you hide tagged items without disturbing the product-card layout or other storefront sections.
Before changing files, duplicate your published theme and work in the copy. That gives you a safe way to preview the result and roll back if another part of the layout is affected.
Find the product-card loop in your Shopify theme
First, locate the template that outputs the listing you want to change. Theme file names vary, so search for the product loop or the snippet that renders each card rather than relying on one exact filename.
In Shopify admin, go to Online Store → Themes → Edit code. Collection grids often use a section such as main-collection-product-grid.liquid, while search results and featured collections may have separate files. Look for a loop like {% raw %}{% for product in collection.products %}{% endraw %} and note the variable used; some themes pass a product as cardproduct instead.
For a shared card snippet, check where it is rendered before editing: changing the snippet itself could affect every listing that uses it. Shopify’s theme architecture documentation can help you trace how sections and snippets fit together.
Add a tag condition to skip tagged products
Once you have the correct loop, place the condition around the existing card output. This keeps the theme’s markup intact and tells Liquid to render the card only when the product does not carry your chosen tag.
For a loop whose product variable is product, use this pattern:
{% raw %}{% for product in collection.products %}
{% unless product.tags contains 'hidefromstorefront' %}
{% render 'card-product', cardproduct: product %}
{% endunless %}
{% endfor %}{% endraw %}Keep the tag spelling consistent with the one in your admin, and substitute your theme’s existing card markup or render call. If the loop uses cardproduct, update the condition to check cardproduct.tags. Preview tagged and untagged items, then confirm that the cards, links, and responsive layout still work.
Adapt Shopify hide products by tag Liquid for featured collections
Featured collections usually have their own section and loop, so the collection-page change may not apply there. Find that section’s product loop and add the same condition around its card output.
For example, if the featured section loops through products using the variable product, the condition remains {% raw %}{% unless product.tags contains 'hidefromstorefront' %}{% endraw %}. If it uses another variable, match that name exactly. This makes Shopify hide products by tag Liquid consistent across the listings you choose, without changing how unrelated theme areas display products.
After saving, preview the featured collection with both tagged and untagged products. A Liquid condition can leave fewer cards in the displayed grid, so check the spacing and item count before publishing the theme.
Test the change and keep it working
A product card disappearing in one preview is a good start—but does the rule hold up across the rest of the storefront? A quick, structured check can catch missed listings and make future theme changes easier to manage.
Begin by testing the places customers use to browse, not just the template you edited. The checks below help confirm that the filter behaves consistently on different screens.
Check collections, search results, and mobile layouts
Use one tagged product and one untagged product as test cases. Check each relevant storefront view so you can confirm that the tagged item is omitted while ordinary products still appear.
Review the results in a preview of your duplicated theme, including:
- Collection pages that use the edited loop.
- Search results and featured collections, if you added filters there.
- Mobile layouts, where fewer cards can affect grid spacing or leave an uneven final row.
Also test pagination or “load more” behavior if your theme uses it. Since a Liquid condition skips card output, check whether the page still looks balanced and whether customers can navigate the remaining results as expected.
Once the main views look right, a few small checks can help prevent the filter from breaking later. Tag consistency and theme maintenance are especially worth keeping on your checklist.
Troubleshoot tag spelling, theme updates, and cached pages
If a tagged product still appears, first compare its tag with the exact text in the condition. Check for spelling differences, extra spaces, or a condition that references the wrong product variable.
If the code looks correct but the storefront appears unchanged, preview the theme directly and refresh the page. A browser or app may show a cached view; compare in a private browsing window before changing the code again. After a theme update, recheck your edited files because the update may replace or alter customized sections.
Keep a brief note of the file changed, the tag used, and the test products. That record makes it easier to verify the filter after updates and maintain Shopify hide products by tag Liquid across the listings you chose.
Finally, make sure the display rule matches the level of privacy you actually need. A theme filter changes what a listing renders, but it is not an access restriction.
Use access controls when products must stay private
If customers must not view or buy an item, don’t rely on hiding its card alone. Review the product’s sales-channel availability and use a suitable access-control or gated-store solution for restricted content.
For example, a tagged item intended for a launch preview might be hidden from collection grids, while a genuinely private product should have its access and purchasing permissions handled separately. Test the direct product URL as part of your checks, and choose controls that match your store’s requirements.
Keep your storefront curated—and your products protected
With a clear product tag and a carefully placed Liquid condition, you can control which items appear in the storefront areas you choose. Test the change across collections, search, featured sections, and mobile layouts, then revisit it after theme updates to keep everything working smoothly.
Remember, Shopify hide products by tag Liquid controls display—not access. If a product must remain private or unavailable to customers, use appropriate access and sales-channel controls as well. With that distinction in mind, you can keep your catalog organized and your storefront focused on the products you want shoppers to see.