> For the complete documentation index, see [llms.txt](https://docs.strm.design/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.strm.design/products/metafields.md).

# Metafields the theme reads

Every metafield Stratum reads, what it shows and how to create it.

**Metafields** are extra fields you add to products, blog posts and other content in Shopify admin — material, capacity, care instructions, a list of related products. Stratum reads a few metafields by fixed names and lets you choose others in settings.

## Metafields with fixed names

| Metafield                 | On         | Type             | What it shows                                                                                                                            |
| ------------------------- | ---------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `reviews.rating`          | Products   | Rating           | Stars in the **Rating** block, the **Product details line**, the **Product reviews** section and the **Rating** row on the compare page. |
| `reviews.rating_count`    | Products   | Integer          | The number of reviews next to the stars.                                                                                                 |
| `custom.related_products` | Blog posts | List of products | The products shown under a blog post (the **Products heading** in the **Blog post** section, default "Used in this story").              |

{% hint style="info" %}
You don't create the `reviews` metafields yourself. Product review apps (Judge.me, Okendo, Shopify Product Reviews and others) write them automatically. If stars don't show, check that your review app is set to sync ratings to Shopify metafields.
{% endhint %}

## Metafields you choose in settings

| Where                                              | Setting                                                            | How many   |
| -------------------------------------------------- | ------------------------------------------------------------------ | ---------- |
| **Specifications** block on the product page       | **Row 1 metafield** … **Row 6 metafield**, each with a label       | 6          |
| **Specification** blocks inside **Specifications** | **Value** — connect it to a metafield with the dynamic source icon | Any number |
| **Theme settings › Product compare**               | **Row 1 metafield** … **Row 4 metafield**, each with a label       | 4          |

Write the metafield as `namespace.key`, for example `custom.material`. You'll find both parts on the metafield definition in **Settings › Custom data**.

These value types display well:

* Single line text and multi-line text
* Integer and decimal numbers
* True or false (shows **Yes** or **No** in Specifications)
* Lists of the above (shown comma-separated)

Rows whose product has no value are hidden in Specifications and show "—" on the compare page.

## Create a metafield definition

1. In Shopify admin, go to **Settings › Custom data**.
2. Click **Products** (or **Blog posts** for `custom.related_products`).
3. Click **Add definition**.
4. Enter a **Name**, for example "Material". Shopify fills in the **Namespace and key** as `custom.material` — this is what you enter in the theme setting.
5. Click **Select type** and choose the type, for example **Single line text**. Choose **One value** or **List of values**.
6. Click **Save**.

Then fill it in on each product: open the product, scroll to **Metafields** at the bottom, and enter the value.

## Example: show material on the product page and the compare page

1. Create a product metafield definition "Material" (`custom.material`, single line text).
2. Fill it in on your products, for example "Enameled cast iron".
3. Theme editor › **Product information** › **Specifications** block: **Row 1 label** "Material", **Row 1 metafield** `custom.material` (these are the defaults).
4. **Theme settings › Product compare**: **Row 1 label** "Material", **Row 1 metafield** `custom.material` (also the defaults).

## Example: products in a blog post

1. Create a blog post metafield definition "Related products" with **Namespace and key** `custom.related_products` and type **Product**, **List of values**.
2. Open a blog post, scroll to **Metafields** and choose the products.
3. The post shows them under the article, with the heading set in the **Blog post** section.

## Common mistakes

* **Wrong key:** `material` alone won't work — include the namespace: `custom.material`.
* **Wrong owner:** a *variant* metafield won't show in a product setting; create the definition under **Products**.
* **Rich text or file metafields** in Specifications show as raw text. Use single line text, numbers, true/false or lists.
