Hi everyone,
I’m working on a Shopify OS 2.0 store and facing an SEO-related issue with invalid collection sub-URLs, and I’d like confirmation on best practices or limitations.
Problem
Shopify allows URLs like:
Even though:
-
word or abcd are not real collections
-
They are not valid tags in some cases
-
The URL should ideally behave like a 404
Instead, Shopify either:
This has resulted in soft-404 URLs being indexed by Google.
What I’m trying to achieve
For URLs like:
/collections/{collection-handle}/{anything-invalid}
I want:
-
URL to stay the same (no redirect)
-
Page UI to show 404 content
-
Meta title to be “404 – Page not found”
-
noindex, nofollow for SEO
-
No products / filters / banners rendered
Essentially, a soft-404 that Google understands correctly.
What I’ve learned so far
-
Shopify OS 2.0 does not allow returning a real 404 HTTP status for collection pages
-
{% return %} is not supported
-
You cannot render a section (main-404) inside another section
-
Each section renders independently, so injecting a 404 does not stop other sections
-
The only workable solution seems to be conditionally suppressing all collection sections and rendering a single 404 UI
Current approach
At the top of each collection section, I detect invalid paths like this:
{% liquid
assign path_parts = request.path | remove: ‘/collections/’ | split: ‘/’
assign is_invalid_collection_url = false
if path_parts.size > 1 and path_parts[1] != blank
assign is_invalid_collection_url = true
endif
%}
Then:
-
All collection sections do not render if is_invalid_collection_url == true
-
One section renders a custom 404 UI
-
Meta title is updated via JavaScript
-
Robots meta is set to noindex, nofollow
This works visually, but it feels like a workaround.
My questions
-
Is this the recommended / accepted approach for soft-404s in Shopify OS 2.0?
-
Is there any cleaner way to:
-
Is Shopify planning any native support for handling invalid collection sub-paths?
Any confirmation, improvements, or alternative ideas would be greatly appreciated 
Thanks!
Yes, URLs like /collections/collection-handle/tag render collection with handle collection-handle filtered by tag tag.
There can also be /collection/collection-handle/tag1+tag2 (but these a re by default denied in robots.txt).
template area of the page is rendered with code similar to:
So rather than modify multiple sections, better generate soft 404 here, like this:
<main id="MainContent" class="content-for-layout focus-none" role="main" tabindex="-1">
{% if request.page_type == "collection" and current_tags %}
{% # ... soft 404 HTML ... %}
{% section 'soft-404' %}
{% else %}
{{ content_for_layout }}
{% endif %}
</main>
I would not be expecting any changes from Shopify here.
Make sure your not creating false-positive logic, shooting yourself in the foot.
It can be better to show a link to search for that stub , or show literal search results, or product recommendations here.
Design for customers, bots last. Bots are not the customers, people are; least for a little while longer /sigh.
Theres a subtle footguns here, /{anything-invalid} matches to existing tags so the stub is always a valid url whether the content is or not valid itself.
I.e. a collection has products tagged red, and none tagged rad
e.g. /collections/{collection-handle}/red
Would be a valid url.
e.g. /collections/{collection-handle}/rad
Would be a valid url with a TYPO.
Purposefully crippling page content here ambiguously under some shotgun rule of “invalid” can be a very costly idea.

Kludge,
I don’t recommend it , but if someone really has to pursue this.
Could explore just nixing those urls completely in robots txt e.g. collections/*/*.
Either hardcoded or conditionally with liquid.
Test and be sure /products endpoints aren’t getting nixed too.
It would all be simpler if shopify had put tags suffixing on it’s own path , /tags/.. but nooooope.
Thanks for the suggestion! We actually tested the soft-404-in-theme.liquid approach, but ran into a core SEO limitation: Shopify still returns a 200 HTTP status even for invalid tag paths like /collections/valid/invalid.
While the UI looks like a 404 and we can add noindex, Google treats 200 pages as “live” — leading to soft-404 warnings and wasted crawl budget.
So instead, we’ve taken a lighter approach: keep the page fully functional for users, but add <meta name="robots" content="noindex, nofollow"> whenever current_tags is present. This preserves UX while telling search engines not to index thin/empty filtered views.
It’s not perfect, but it’s the best balance we’ve found so far under Shopify’s constraints.
Really appreciate the UX warning — and you’re absolutely right: we shouldn’t break the journey for typos or exploratory filters. That’s why we avoided hiding content (like a full soft-404 would).
Instead, we kept the collection page fully intact (products, filters, recommendations stay visible), but added noindex, nofollow only when current_tags exists.
This way:
-
Shoppers still get a usable page (even for /rad instead of /red)
-
Google stops indexing zero-result or thin filtered views
-
We avoid penalizing real user behavior
We’re also exploring smarter empty states (e.g., “Did you mean…?” or product suggestions) to make these pages more helpful. If you’ve seen effective patterns for that, I’d love to hear them!