Studio Theme - Need help hiding collections from list using True/False metafield

Topic summary

Hiding select collections from the All Collections page using a collection-level True/False metafield in Shopify’s Studio theme.

  • Requirement: Use metafield custom.hide_collection_from_storefront so collections remain visible when FALSE and are hidden from the All Collections list when TRUE, while still accessible via direct URL.

  • Solution: Edit Sections > main-list-collections.liquid. In the for loop over collections, render each collection card only if collection.metafields.custom.hide_collection_from_storefront.value == false. This limits visibility on the collections listing page without blocking direct access to the collection URL.

  • Implementation details: The change wraps the card-collection render inside an IF condition tied to the metafield value. Code snippet edits are central to the solution.

  • Outcome: The original poster confirmed the fix worked immediately.

  • Status: Resolved; no remaining questions or disagreements.

Summarized with AI on December 25. AI used: gpt-5.

I’m looking for advice on how to hide multiple collections from the All Collections List, using a True/False metafield at the collection level.

I’m hoping there is a way to utilize the metafield so that when it is FALSE, the collection is not hidden; but can only be accessed through a URL link if set to TRUE (metafield key is custom.hide_collection_from_storefront ).

Instructions

  1. Go to ‘Online Store’ → Themes

  2. From your Active Theme → Click on the 3 dots (…) → Edit Code

  3. In the Sections Folder locate the file called ‘main-list-collections.liquid’ or something similar

  4. Find the below for loop

{%- for collection in collections -%}
  - {% render 'card-collection',
        card_collection: collection,
        media_aspect_ratio: section.settings.image_ratio,
        columns: 3
      %}
  

{%- endfor -%}
  1. Surround everything inside the for loop with this:
{%- for collection in collections -%}
  {% if collection.metafields.custom.hide_collection_from_storefront.value == false %}
  - {% render 'card-collection',
        card_collection: collection,
        media_aspect_ratio: section.settings.image_ratio,
        columns: 3
      %}
  

{% endif %}
{%- endfor -%}

Hope this helps

Oh my gosh thank you so much!! I’ve been trying to figure this out ALL day. What you suggested worked immediately and your explanation was basically foolproof.

1 Like