EU compliance6 min read

Allergens on Shopify: Boolean Metafields, Comma Lists or Tags?

One boolean metafield per allergen, comma-separated text split in Liquid, or tags: what each costs a food shop, and a way to show EU allergens and nutrition without code.

In this guide
  1. Why do merchants end up with a metafield per allergen?
  2. Why does comma-separated metafield text break?
  3. What is wrong with using tags for allergens?
  4. How do the options compare?
  5. What does the EU product page actually need?
  6. How do you show allergens and nutrition without Liquid?
  7. FAQ
  8. Try it on one product

To show allergens and nutrition on a Shopify product page, most food shops end up with one of three workarounds: a true/false metafield for each allergen, one text metafield with the allergens separated by commas and split apart in Liquid, or product tags. Each one can work, but each one makes you maintain the same information in two places and keep custom theme code alive. If the goal is the EU product page itself (a nutrition table, ingredients with the allergens in bold, and the food business operator), you can fill that in once per product in an app form and place it with a theme block instead.

This guide compares the three workarounds, explains where each one breaks, and shows the steps for the form-and-block route.

Why do merchants end up with a metafield per allergen?

Shopify gives you product metafields, and the obvious way to model “contains milk” is a true/false metafield called contains_milk. The EU lists 14 allergen groups that must be emphasised, so you create 14 definitions: milk, eggs, cereals containing gluten, peanuts, nuts, soybeans, fish, crustaceans, molluscs, celery, mustard, sesame, lupin, and sulphur dioxide and sulphites.

Then the work starts:

  • Every product needs 14 answers. A new biscuit means opening the product, scrolling to the metafields and ticking boxes, on top of typing the ingredient list.
  • The ticks and the ingredient list drift apart. The law asks for the allergen to be emphasised in the ingredient list itself. The boxes are a second copy of the same fact, and when a recipe changes, someone has to update both.
  • The page still needs Liquid. A theme shows a true/false metafield as “true” or “false”, not as “Contains: milk”. Turning 14 booleans into a readable line means a loop or 14 if blocks in a snippet.

Why does comma-separated metafield text break?

The other common route is one single-line text metafield such as milk, eggs, wheat, split in Liquid with split: ',' and printed as a list or badges. It is quicker to fill in, and it fails in small, quiet ways:

  • A missing comma or an extra space produces an item like eggs or milk eggs, and badges or comparisons stop matching.
  • Spelling becomes data: Milk, milk and dairy are three different values.
  • Nutrition gets the same treatment, as Energy|1650 kJ|Fat|12 g split on a pipe, and one missing pipe shifts every row of the table.
  • The snippet lives in the theme. A theme update or a new theme can drop it, and you find out when a customer asks why the allergens vanished.

If your metafields show a heading but no value at all, that is a separate issue: see our guide to nutrition and allergen metafields not showing.

What is wrong with using tags for allergens?

Tags look attractive because themes can filter collections by them. But tags are one flat list shared by everything: sale tags, supplier tags and app tags sit next to contains-milk. A tag-based filter works from the tags on the products in the collection, so it is hard to offer shoppers only the allergen values without the rest coming along, and you end up renaming or cleaning tags to keep the filter usable. Tags also say nothing on the product page by themselves, so they do not replace the emphasised ingredient list either.

How do the options compare?

Boolean metafield per allergen Comma-separated text + Liquid Tags One form per product + theme block
Data entry per product 14 ticks plus the ingredient list One text field plus the ingredient list Several tags plus the ingredient list Ingredient list with allergens marked once
Allergens bold in the ingredient list Needs extra Liquid or HTML Needs extra Liquid or HTML No Yes, words you mark with asterisks
Nutrition table Separate metafields and Liquid Pipe or comma splitting in Liquid No Fields per nutrient, shown as a table
Theme code to maintain Snippet with loops or if blocks Snippet with split Filter setup, nothing on the page None
Typical failure Ticks out of sync with the recipe A stray comma or spelling breaks it Mixed with unrelated tags You still have to enter correct values

What does the EU product page actually need?

Regulation (EU) No 1169/2011 sets out the food information a buyer must get, and for distance selling most of it has to be available before the purchase. On a product page that includes the nutrition declaration, the ingredient list with the allergens emphasised so they stand out from the rest of the text, and the name and address of the food business operator. Booleans and tags describe allergens; they do not by themselves emphasise them in the ingredient list.

This is not legal advice. Our guide to EU allergen information for online food shops covers the rules in more detail.

How do you show allergens and nutrition without Liquid?

These steps use Etiketto: EU Nutrition Labels, a free app that shows the food information Regulation (EU) No 1169/2011 requires on product pages: a nutrition table, ingredients with bold allergens, and the operator.

  1. Install the app and open a product in its editor. Nutrition, ingredients and operator sit on one screen.
  2. Enter nutrition per 100 g in its own fields. Energy in kJ and kcal, fat, saturates, carbohydrate, sugars, fibre, protein and salt. No pipes, no commas. The values come from your own specification or lab results; the app shows them, it does not calculate them.
  3. Type the ingredient list as it is on the pack and wrap each allergen in asterisks, for example oat flakes, honey, *butter* (*milk*). On the product page those words show in bold. The app does not detect allergens, so only the words you mark are emphasised.
  4. Add the food business operator’s name and address.
  5. Add the Food information block in Online Store > Themes > Customize, on the Product template of an Online Store 2.0 theme. Pick a table, accordion, compact or card layout and save. No theme code changes.
  6. Check one live product against the pack, then fill in the rest. Remove the old Liquid snippet or tab so the information doesn’t show twice.

If you are coming from a hand-built collapsible tab, our post on bolding allergens and showing nutrition without HTML or Liquid walks through that switch in more detail.

FAQ

Do I need one metafield per allergen to meet EU rules?

No. The rules ask that allergens are emphasised in the ingredient list and that the nutrition declaration and operator are available before purchase. How you store the data is up to you; per-allergen booleans are one way to model it, not a requirement.

Can I keep my existing allergen metafields?

Yes. Metafields you use for other purposes, such as collection filters, can stay. If you show the food information with a theme block, take the old snippet off the product page so shoppers don’t see the allergens twice.

Does Etiketto work out which allergens are in my ingredients?

No. You mark allergens yourself with asterisks, and only those words are bold. Before you mark a list, compare it with the 14 allergens in Annex II of Regulation (EU) No 1169/2011.

Does it calculate nutrition values from a recipe?

No. You enter the values from your specification or lab results and the app shows them as a table. The free EU nutrition label generator can help you work out energy and rounding first.

Try it on one product

If you are tired of ticking 14 boxes, splitting commas in Liquid and cleaning up tags, try Etiketto: EU Nutrition Labels from the Shopify App Store, fill in your first product, and add the Food information block to your product page.