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

Search products by metafield

If your products have custom metafields (material, technical specs, certifications, and so on), you can include them as a searchable field so shoppers can...

What this does

Search normally only looks at built-in fields like title, tags, and description — it has no knowledge of custom metafield values unless you add the metafield as a searchable field. For example, if a product has a Material metafield set to "Merino wool", a shopper searching "merino" gets no match by default, since that word appears nowhere in the title, description, or tags. Adding Metafield as a search field (and declaring which metafield to use) makes that value searchable too, so the same search for "merino" now finds the product.

Prerequisites

  • The metafield must already exist and have values set on your products in Shopify.

  1. In the app, go to Settings > Metafields.

  2. Click Add metafield.

  3. Choose Resource (Product or Variant), then enter the metafield's Namespace and Key exactly as defined in Shopify.

  4. Under Applies to, make sure Search is checked — this is what makes the metafield's value searchable. Declaring a metafield without turning this on only makes it available for the fields you did check (e.g. filter, sort), not search.

  5. Click Sync metafields, then click Save in the bar at the top of the page.

If the metafield isn't declared yet at all, see Filter products by metafield for the full declaration steps.

Step 2: Add it to search relevance

  1. Go to Search > Settings.

  2. Under Product fields to search, check Metafield.

  3. Drag it into the position that reflects how much weight it should carry in ranking.

  4. Click Save in the bar at the top of the page.

Last updated

Was this helpful?