Can Metafields only show if there is data inside of them?

I’ve created a few Product Metafields for my product page. For example: Specs; Features; Care Instructions. – But not all products have this info.

I’m surprised that this feature in Shopify doesn’t have a checkbox where it says to not show if the field is empty. Since there is a problem when the shopper goes and tries to click on the Multi-field and it doesn’t open because its empty.

Is there a way to solve this? Much thanks in advanced!

Hi,

Hope this will help

  • At Product Page File and Add Liquid Code Where You Want the Metafield to Show

Example:

if you want to show “Care Instructions” metafield only if it has content:

{% if product.metafields.custom.care_instructions != blank %}

 ### Care Instructions 

{{ product.metafields.custom.care_instructions }}

 
 {% endif %}
  • Replace custom and care_instructions with your actual metafield namespace & key.

  • Repeat this for each of your fields

thank you for the reply. Would this be on the product liquid page? I’ve tried it in a few places but dont see anything changing.