A Shopify user is struggling to hide empty metafields from displaying on product pages, specifically wanting to hide 4 collapsible rows and 2 icons when no metafield data exists.
Initial Solution Provided:
Add an if statement in the main-product.liquid file
Wrap the collapsible tab block code with {% if block.settings.content != blank or block.settings.page.content != blank %}
Close with {% endif %}
Complications:
The solution hides both empty AND filled metafields
User needs multiple collapsible rows (more than one)
Metafields are using “rich text” type rather than “text” type, which may be causing the issue
Extended Question:
Another user successfully applied this method to products and asks how to implement the same logic for collections templates, specifically:
How to hide individual collapsible rows inside a content section when their metafields are empty
How to hide the entire collapsible content section if all metafield rows are empty
Status: The discussion remains open with unresolved questions about rich text metafields and collection-level implementation.
Summarized with AI on November 11.
AI used: claude-sonnet-4-5-20250929.
I’m trying to solve this for hours now, but i can’t do it. I have tried all the guides here in the community on this topics but non of those work with the newest this one https://community.shopify.com/c/technical-q-a/metafields/m-p/2072928#M127871 . I want to hide 4 collapsable rows and 2 icons with text when they are empty (they do not have metafileds fill in). Does anyone knows how to do this?