Blog

How to add nutrition facts and dietary filters to Shopify

Wellness shoppers read the label before the price. Put it on the product page from your own product data, then let them filter by what they eat and what they avoid.

Peak
A smoothie mix product page on the Peak demo store with a Fits: Vegan badge, Vegan, Gluten free and Dairy free icons, a Nutri-Score and a nutrition facts table

Quick answer

To add nutrition facts to Shopify without an app, store each value in a product metafield and show them in a table on the product page that reads from those fields. Give ingredients and allergens their own metafields too. For dietary filters, set each product’s category in Shopify’s product taxonomy, fill in its Dietary preferences category metafield, and add it as a filter in Shopify’s free Search & Discovery app. In Peak (part of the Ignite theme), the Table block builds the nutrition panel, and My Preferences lets shoppers save what they eat and avoid, so matching products are marked as they browse.

We make Peak, so the theme steps in this guide use it. The groundwork, from metafields to filters, is Shopify’s own and works with any theme.

What shoppers look for before they buy

Someone choosing a protein powder has usually narrowed it down to two tubs that promise much the same thing. What decides it is the small print: grams of protein per scoop, how much sugar, whether there’s dairy in it, and whether it suits the way they eat.

That small print tends to end up in the product description, typed out by hand or shown only in a photo of the pack. It works until the formula changes and someone has to remember which forty products to edit. It also can’t be filtered or reused. A shopper can’t ask your store for everything that’s vegan and nut-free if “vegan” only exists as a word in a paragraph.

The fix is to treat the label as product data. Each fact gets its own field, the product page reads from it, and the same fields power your filters, your badges and, if you want, your structured data for AI search.

Decide where each fact lives

Shopify gives you two kinds of field for this, and a wellness store usually needs both.

Category metafields come from Shopify’s standard product taxonomy. Set a product’s category, such as Health & Beauty > Health Care > Fitness & Nutrition > Vitamins & Supplements, and Shopify offers fields made for it, including Dietary preferences, Allergen information and Detailed ingredients. You choose values from Shopify’s own list, such as Vegan, Gluten-free, Keto and Nut-free, so they’re spelled the same on every product. These are the fields to filter by.

Custom metafields are ones you define yourself in Settings > Metafields and metaobjects > Products. Use them for anything taxonomy doesn’t cover, which includes the numbers on the label. A typical supplement store ends up with something like this:

Where each fact on a supplement label can live in Shopify.
What it holdsFieldType
Diet and free-from claimsDietary preferencesCategory metafieldFrom Shopify’s listVegan, Nut-free
AllergensAllergen informationCategory metafieldFrom Shopify’s listMilk, Soybeans
Serving sizecustom.serving_sizeSingle line text1 scoop (30 g)
Each nutrient or active ingredientcustom.protein, custom.vitamin_dSingle line text24 g
Full ingredients listcustom.ingredientsMulti-line text or rich text
Dietary iconscustom.iconsFile, list of files

Plan the list in a spreadsheet first, one row per product and one column per field. It’s much easier to spot a missing value there than across a hundred product pages. And keep the units in the value, 24 g rather than 24, so the table reads correctly without extra setup.

Build the nutrition or supplement facts panel

In Peak, the panel is a Table block with two columns and up to 15 rows. Each cell can hold fixed text, such as a label, or read from a metafield, such as a value.

  1. Create the metafields in your Shopify admin and fill them in on each product.
  2. In the theme editor, open your product template and add a Table block to Product information.
  3. Type a label in each row’s first cell, such as Protein.
  4. In the second cell, click the database icon and choose the matching metafield, such as Protein.
  5. Choose how it shows. Show as a Collapsible Row tucks it under a heading, such as Nutrition facts, and turning it off shows the table open on the page.
  6. Click Save.
Table cells in the theme editor connected to metafields, with arrows to the matching rows of a compatibility table on the Alpha demo store
How cells connect to metafields, shown on Alpha’s fitment table. A nutrition panel works the same way.

Rows with no value are hidden, so one table works for your whole range. A capsule with four active ingredients shows four rows, and a shake with twelve nutrients shows twelve. When only one cell in a row is empty, it shows a dash. Change that with Value for empty cells, or hide those rows with Hide row if Cell 2 is empty.

Most of the questions we get once real products go in are about four things.

Supplement Facts or Nutrition Facts

In the US, dietary supplements carry a Supplement Facts panel rather than Nutrition Facts. The table shows whatever heading you give it, so use the one on your pack.

Panels longer than 15 rows

Add a second table. Peak’s demo store splits a shake’s panel in two, with the main nutrients in one table and vitamins and minerals in another.

Flavors with different values

Put those values in variant metafields instead, then type the namespace and key in square brackets in Cell 2, such as [custom.calories]. The value changes when the shopper picks a flavor. It works for the first 250 variants.

The label on the pack

A table is easy to read and easy for search engines to pick up, but it isn’t a copy of the regulated panel on your pack. Add a clear photo of the real label to the product images too, and say that the pack is the final word if anything differs.

Give ingredients and allergens their own space

A full ingredients list is too long for a table row. A question we answer a lot in support is how to give each product its own list, and the answer is a Collapsible row block that reads from a metafield.

  1. Create a product metafield for the list, such as custom.ingredients, as Multi-line text or Rich text, and fill it in on each product.
  2. Add a Collapsible row block to Product information and give it a Heading, such as Ingredients.
  3. Click the database icon in Content and choose the metafield under Template > Product, then click Save.

The row only shows when there’s content to show, so a product without the metafield simply doesn’t get one. Repeat it for allergens, directions or warnings, with one row each.

For a statement that’s the same on every product, such as how your kitchen handles nuts, a metafield is overkill. Peak’s demo store uses a Pop-up button block instead, a small Allergen Information link that opens your full policy in a side panel. See the Pop-up button block.

Show the claims at a glance

Shoppers scan before they read. Icons and short badges near the title answer “is this for me?” in a second.

Dietary icons

Peak’s Product icons block shows a row of icons from a product metafield. Create a File metafield with List of files and the namespace and key custom.icons, then upload icons such as a vegan leaf or a gluten-free symbol to each product. Add the Product icons block to Product information, and turn on Show product icons in Theme settings > Product cards to show them on collection pages too.

Each image’s alt text becomes its label under the icon and its hover text on product cards. Write it the way a shopper would say it, like Vegan or Gluten free, not icon-vg-02.

Peak preset with dietary icons, a Nutri-Score rating, a nutrition facts table and product cards
Dietary icons, a Nutri-Score and a nutrition table on Peak.

Short claims as badges

For claims that read better as words, such as Soy free or Sugar free, the Highlight badges block shows each value of a Single line text list metafield, custom.highlights, as a small badge.

Nutri-Score, for foods

The Nutri-Score block shows the A to E grade, with the product’s letter raised. Its Score is a text setting, so connect it to a single line text metafield holding the letter, and each product shows its own grade. Leave the metafield empty and the block doesn’t show.

Nutri-Score is voluntary. It’s used in Belgium, France, Germany, Luxembourg, the Netherlands, Spain and Switzerland, and it’s designed for everyday foods and drinks, so food supplements generally fall outside it. It earns its place on cereals, snacks and drinks more than on capsules.

Let shoppers filter by what they eat

Once Dietary preferences is filled in, filtering takes a few minutes.

  1. Install Shopify’s free Search & Discovery app, if you haven’t already.
  2. Go to Filters and add a filter for Dietary preferences. Add Allergen information or Detailed ingredients too, if shoppers would use them.
  3. Open a collection on your storefront and check the new filter appears.

A filter only lists values that at least one product in the collection has, with a count beside each one. That keeps shoppers away from empty pages, and it doubles as a check on your data. If Vegan (3) looks low, you’ve probably left some products unfilled.

Filter by what’s left out

Shopify’s filters show products that have the value a shopper picks. They can’t hide products that have it, so an Allergen information filter of Nuts finds products with nuts, which is the opposite of what an allergic shopper wants. That’s why free-from values matter. Dietary preferences includes Nut-free, Dairy-free, Soy-free and Gluten-free, so fill those in wherever they’re true.

A Dietary preferences filter on the Peak demo store with options such as Dairy-free, Gluten-free, Keto, Nut-free and Organic, each with a product count
A Dietary preferences filter, built from the category metafield.
A My Preferences panel with High protein, Gluten-free and No artificial colors saved
My Preferences, with three saved preferences.

Remember each shopper’s diet

Filters work one visit at a time. Someone who eats vegan is still vegan next week, and shouldn’t have to tick the box again. Peak’s My Preferences, which the theme editor calls the Compatibility finder, lets shoppers save up to five preferences, such as Vegan and Nut-free. They don’t need an account, because the list is kept in their browser. Each saved preference lists your collections that have matching products, and matching products are marked as they browse.

It reads the same filters you just set up:

  1. In the Header section, under Call to action & Compatibility finder, turn on Enable call to action and set On click to Open compatibility finder. Peak’s demo store labels it MY PREFERENCES, with the line Pick your tastes or allergies.
  2. Add a Compatibility finder block. Under Filter 1, type the Filter name exactly as it appears on your collection page, Dietary preferences, and a Dropdown label, such as Choose a preference.
  3. Set Use filters from this collection to a collection with your whole range, choose the Collections to show in the panel, then click Save.

For the badges, add a Compatibility badge block to Product information, and choose a placement for Compatibility badge in Theme settings > Product cards. The message takes [name], which becomes the matching preference. Peak’s demo store uses Fits: [name], which shows as “Fits: Vegan”. Card badges only appear on a match, so collection pages stay clean.

The Compatibility finder guide has every setting. It’s the same feature that runs My Garage for car parts on Alpha, pointed at diets instead of vehicles.

Where this setup falls short

Running all of this on Shopify’s own fields keeps the data yours and leaves nothing extra to pay for. It also has limits, and most come from Shopify rather than the theme, so they apply to any theme that works this way.

  • Shopify only shows filters on a collection or search with 5,000 products or fewer. A bigger catalog needs smaller collections, such as one per category.
  • Category metafield values come from Shopify’s list. If a claim you need isn’t there, such as a certification, keep it in a custom metafield instead. A custom metafield can be a filter too.
  • My Preferences lives in the browser. A shopper who clears their browsing data or switches devices starts again.
  • A table isn’t the regulated panel. If you need the FDA’s black-and-white panel format on the page itself, show a photo of the label, or look for an app built for it.
  • Peak’s table takes 15 rows. Long panels need a second table.

And none of it replaces checking your claims. Health and nutrition claims are tightly regulated in many markets. If a product page and the pack disagree, the pack is what counts, so update your metafields whenever a formula changes.

Before you go live

Open three very different products, such as a capsule, a powder and a snack bar, and read each page as a shopper would. Every row in the table should have a value and a unit, no product should be missing its dietary icons, and the filter counts should match what you know is in stock.

Then try it as a shopper with an allergy. Save Nut-free in My Preferences, browse a collection, and check that every product with a badge really is nut-free.

The Table block guide and the Compatibility finder guide list every setting. For everything else Peak does for wellness brands, see Peak for supplements and wellness stores, or read the 5 best Shopify themes for supplements and wellness.

Questions

How do I add nutrition facts to a Shopify product page without an app?

Store each value in a product metafield, such as calories and protein, then show them in a table on the product page that reads from those metafields. In Peak, the Table block takes up to 15 rows, each cell can pull from a metafield, and rows without a value are hidden. Set up the Table block.

Can I show Supplement Facts instead of Nutrition Facts?

Yes. The table shows whatever labels and values you give it, so call it Supplement Facts and list each ingredient with its amount per serving. In the US, dietary supplements carry a Supplement Facts panel rather than Nutrition Facts, so match the label on your pack.

How do I let shoppers filter by vegan, gluten-free or keto on Shopify?

Set each product’s category in Shopify’s product taxonomy, fill in its Dietary preferences category metafield, then add that metafield as a filter in Shopify’s free Search & Discovery app. Any theme that supports Shopify’s filters shows it on collection pages.

Can shoppers save their dietary preferences on a Shopify store?

Yes, in Peak. My Preferences, which the theme editor calls the Compatibility finder, lets shoppers save up to five preferences, such as Vegan and Nut-free, without an account. Products that match show a badge on the product page and on product cards. Set up My Preferences.

Can a Shopify filter hide products that contain an allergen?

Not directly. Shopify’s filters show products that have the value a shopper picks, so they can’t hide everything that contains nuts. Use free-from values, such as Nut-free or Dairy-free in the Dietary preferences category metafield, so shoppers can pick what they want instead.

Can each flavor or size have its own nutrition values?

Yes, with variant metafields. In Peak’s Table block, type the variant metafield’s namespace and key in square brackets in Cell 2, such as [custom.calories], and the value changes when the shopper picks a variant. This works for the first 250 variants.

Should supplements show a Nutri-Score?

Usually not. Nutri-Score is a voluntary A to E grade for foods and drinks, used in Belgium, France, Germany, Luxembourg, the Netherlands, Spain and Switzerland, and food supplements generally fall outside it. It suits snacks, cereals and drinks better than capsules.

This page contains affiliate links to the Shopify Theme Store. If you buy a theme through one, we may earn a commission, whichever theme you choose.

More from the blog