For the complete documentation index, see llms.txt. This page is also available as Markdown.

Using metafields as AI context

Choose which of your metafields the AI reads, and understand exactly what it is shown.

By default the AI writes from a product's title, type, tags and current description. If the real facts (fabric, dimensions, care, warranty) live in metafields, tick them and the AI writes from those.

Choosing the metafields

  1. Open AI Prompts and select a prompt.

  2. Under the prompt text, tick the metafields that prompt should see.

  3. Save.

The picker is available on these prompts:

  • Products: Title, Description, Metafields, SEO and FAQ Generation — the list shows your product metafields.

  • Collections: Description, SEO and FAQ Generation — the list shows your collection metafields.

Things to know:

  • Each prompt has its own selection, up to 20 metafields.

  • Ticks take effect when you save. Preview uses unsaved prompt text but the saved metafield selection.

  • Shopify's own metafields are hidden until you tick Show Shopify metafields.

  • A metafield missing from the list has no definition. See Creating metafields.

What the AI is shown

Each ticked metafield with a value is passed as one line: its name, then its value. Empty ones are left out.

Care instructions: Cold machine wash. Do not tumble dry. Fabric composition: 95% organic cotton, 5% elastane

Because the AI sees the name, you can refer to a metafield in your prompt:

Take the sizing advice from Fit notes. If Fit notes is empty, do not mention sizing at all.

How each type is read

Metafield type
What the AI receives

Single line and multi-line text

The text as it is

Rich text

The text, without its formatting

A list of values

The values, separated by commas

Number, date, true or false

The value as stored — 12, 2026-12-01, true

Dimension, weight, volume

The value and unit — 10 cm, 1.2 kg

Rating

The rating and its scale — 4/5

Money

The amount and currency

Link

The link text and the address

Product or collection reference

The title of that product or collection

Metaobject reference

The entry's title, label or name; if it has none, all of its fields

A list of references

As above, for the first five entries only

JSON

The JSON as stored, with your key names unchanged

Colour

The colour code, for example #1a2b3c

File, page and variant references

Not readable — the AI receives an internal ID. Leave these unticked

Text gives the best results. A sentence the AI can quote is more useful than a number without context.

Long values

Long values are shortened, not left out: each is cut at about 1,000 characters, and the longest are trimmed further when the total runs long. Keep the part that matters near the start.

Getting more from it

  • Tick facts, not everything. Internal codes and flags dilute the ones that matter.

  • Tell the prompt what to do with them: "Mention the material in the first sentence."

  • Fill the gaps first. If a metafield is mostly empty, generate it, then use it as context.

  • Check with Show thinking to see which details the AI used.

Last updated