Metafield Text - Is it possible to change its appearance (e.g. Bold, Italic)

Topic summary

The discussion addresses how to apply text formatting (bold, italic) to Shopify metafield content, which doesn’t natively support styling.

Initial Solution:

  • Wrap metafield output with HTML <strong> or <b> tags in the theme’s liquid template files
  • Works for simple cases where entire metafield needs formatting

Advanced Solution for Selective Bolding:
A workaround was developed for cases requiring specific words bolded (e.g., allergen ingredients for legal compliance):

  1. In the metafield editor, wrap words needing bold formatting with pipe symbols: |WHEAT|
  2. Modify main-product.liquid in the theme’s sections folder
  3. Add custom Liquid code that splits content by pipes and applies <b> tags to alternating segments
  4. The code checks if the heading contains specific text (e.g., ‘Ingredients’) before applying formatting

Key Limitations:

  • Solution is somewhat “tricky” and requires manual code editing
  • Initial code example only works for one specific metafield
  • Different themes may require different implementation approaches
  • Users requested but didn’t receive solutions for: applying to multiple metafields simultaneously, adding tables to metafields, and displaying file list metafields

Status: The core solution works but remains theme-specific and requires technical knowledge to implement.

Summarized with AI on October 30. AI used: claude-sonnet-4-5-20250929.

As stated in the topic, does anyone know is it possible to change meta field data text appearance?

For example, I would like to bold the Recommended Face Size content on the product page but this text is here in the dynamic meta fields.

Thanks

plz use the bold/strong tags on the page where this field will be shown

 **metafield here** 
1 Like

Thank you!

Hi where dose this code go please i need bold text in meta fields multi line

Hi @sweetbuddie where do you want to show the meta field?

product page please

i need some text in bold it will differ between different products as allergy ingredients have to be in bold by law

please share some data so I can have a look at which type of data it is and how it will look.


Ingredients

For allergens please see ingredients listed in bold.

Sugar, Glucose Fructose Syrup, Invert Sugar Syrup, Wheat Flour, Corn Starch, Vegetable Fat (Palm), Acids (Malic Acid, Citric Acid), Humectant (Glycerol) Potato Stach, Maltodextrin, Flavouring, Thickening Agent (Arabic Gum), Acidity Regulator (Potassium Citrates), Salt, , Fruit and Vegetable Concentrates (Carrot, Blackcurrant).Colour (E120)

an example of a products ingredients tab i need with WHEAT in bold

HI @sweetbuddie please follow this guide carefully. It’s a little bit tricky. First, go to the product editor, and in the meta-field add the ingredients. now for words you want to show as bold, wrap them around with pipeline ( | ) as shown in the screenshot below.

Now go to the theme editor and open the file ‘main-product.liquid’ in the sections folder. now replace the code highlighted in the below picture with the new code below.

code

{% if block.settings.heading contains 'Ingredients' %}
              {% assign beatles = block.settings.content | split: "|" %}
               {% for member in beatles %}
                  {% assign value = forloop.index | modulo:2 %}
                  {% if value != 0  %}
                  {{ member }}<b>
                    {% else %}
                  {{ member }}
                   </b> {% endif %}
                {% endfor %}
              {% else %}
              {{ block.settings.content }}
                {% endif %}

3 Likes

How silly Shopify dose not offer this naturally thanks alot it has worked

could you help me out with something else so the same with the tabs just i have a collapsible row products Nutritional Values and i need a table in it so it looks like the photo dose not have to loo exactly this this

and also i have another tab Dietary And Lifestyle as a file list tab i added the photos but nothing is showing up on the website

Please share the store URL and also how many products in total you have.

1 Like

sweetbuddies.co.uk password Scarr123 i will be having over 100 products

Hi @sweetbuddie this will require multiple code changes in your store

i’m up for it :smiling_face_with_sunglasses:

are you easy with making code changes by yourself?

yea i have done abit

please copy the code of main-product.liquid file and paste it into the following google doc file.

https://docs.google.com/document/d/1ooUpb_3vGSyc28EB4FDGPZYU5X9J053_IAgKaSMWnKA/edit?usp=sharing

ok think i did it