# Metafields

Metafields are extra data you attach to products, beyond the standard title/price/description. DRIFT Studio uses them to power features that wouldn't fit into Shopify's default product fields.

## What metafields DRIFT Studio uses

| Metafield               | What it does                                          | Type             |
| ----------------------- | ----------------------------------------------------- | ---------------- |
| `custom.badge`          | Shows a custom text badge on the product card and PDP | Single line text |
| `custom.size_chart`     | Shows a size chart in a modal on the PDP              | Rich text        |
| `custom.colorways`      | Links related products as color variants on the PDP   | Product list     |
| `custom.colorway_color` | The hex color for each colorway swatch                | Single line text |

## Not a metafield, but related

[**Variant Swatches**](/drift/drift-studio/sections-and-features/variant-swatches.md) — Shopify's native swatch system for option values within a single product. DRIFT renders these automatically. Use this when one product has multiple colors. Use the Colorways metafield (above) when each color is its own product.

Detail pages for each:

* [**Custom Badge**](/drift/drift-studio/metafields/badge.md) — override the default sale badge with custom text
* [**Size Chart**](/drift/drift-studio/metafields/size-chart.md) — modal-based size guide on every PDP
* [**Colorways**](/drift/drift-studio/metafields/colorways.md) — link separate products as color variants

## How to set up a metafield in Shopify

You only do this once per metafield, then any product can use it.

1. Open Shopify admin → **Settings** → **Custom data**
2. Pick **Products**
3. Click **Add definition**
4. Fill in:
   * **Name** — human-friendly name (e.g., "Custom Badge")
   * **Namespace and key** — must match exactly what DRIFT expects (see each metafield page)
   * **Type** — must match (text, rich text, product list, etc.)
5. Save

Now go to any product. Scroll to the bottom of the product page in admin. You'll see a **Metafields** section where you can fill in values per product.

## Heads up on namespace and key

DRIFT looks for metafields under the `custom` namespace (Shopify's default for store-managed metafields). The keys must be exactly:

* `custom.badge`
* `custom.size_chart`
* `custom.colorways`
* `custom.colorway_color`

If you use a different namespace or misspell the key, the theme won't find the value and the feature won't activate. No error message — it just silently doesn't show.

## Bulk editing

If you have hundreds of products, edit metafields one at a time isn't realistic. Two options:

* **Shopify's bulk editor** — Products → select multiple → Bulk edit → add the metafield column
* **Matrixify or Excelify apps** — CSV import/export of metafields

Both work fine with DRIFT.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.webexp.dev/drift/drift-studio/metafields.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
