Catalog operations

How to Fix Shopify Metafield Validation Errors Without Breaking Product Pages

Find every invalid Shopify metafield value, decide whether the definition or the data is wrong, and fix it in bulk without leaving gaps on product pages.

On this page

Shopify metafield validation errors mean that saved values no longer match the rules in their metafield definition: the content type, or a validation such as a character limit, a minimum or maximum, a regular expression or a list of allowed choices. To fix them, list every affected record in Shopify admin, decide whether the value or the rule is wrong, correct one product and check its page, then fix the rest in batches. Until every value matches, Shopify says you can't use the metafield.

That order matters. A blank material field may be harmless in Shopify admin but leave an empty accordion on a product page. Clearing the error is only half the job; the product page must still make sense afterward.

What does a metafield definition validate?

A metafield definition is the template for a custom field: it sets which part of the store the field belongs to and what values it accepts, and applies the same rules to every value. Shopify's list of validation options covers these rules:

  • Text: minimum and maximum length, and a regular expression in RE2 syntax. Single line text can also be limited to preset choices, up to 128.
  • Numbers and measurements: minimum and maximum values for integers, decimals, weight, volume and dimension, and a maximum precision for decimals.
  • Dates: the earliest and latest allowed date, or date and time.
  • URLs and files: allowed domains for URLs; Image or Video for file references.
  • References: which metaobject definition a reference may point to and, for category metafields, which taxonomy attribute.
  • Lists: a minimum and maximum number of items. Shopify's metafield limits cap lists at 128 items, or 1,024 for metaobject references.

The content type adds its own rules. Shopify's content types reference says a color uses #RRGGBB format, a URL must be HTTP, HTTPS, mailto:, sms: or tel:, money must use the store currency, dates use ISO 8601, and a file metafield holds one file. Our plain-English guide to Shopify metafields covers definitions, types and setup from the start.

Where does Shopify show invalid metafield values?

Where an error appears is also a clue to how it started.

  • Invalid metafield values page. If you create a definition, or migrate an app's existing metafields to one, and saved values break its rules, Shopify redirects you to this bulk editor page. It lists each affected record with an error description and an editable METAFIELD VALUE column; hover over a cell's i icon to read the error (Fixing metafield validation errors).
  • Fixes needed. If you leave before fixing everything, the metafield definitions page shows a Fixes needed message. View invalid metafields takes you back to the list.
  • The product bulk editor. Saving fails with "Update the invalid values, then save again" when a selected product or variant has an invalid value, even in a column you haven't added. Shopify's bulk editing guide names metafield validation errors and a missing SKU as typical causes.
  • A single product. A value outside the rules isn't accepted. In Shopify's example, an integer field limited to 1 to 5 needs its maximum raised before a product can store 8 (Editing custom metafield definitions).
  • CSV imports. "Validation failed: Value must be a valid product reference" means a metafield points to a product that doesn't exist in the store yet (common product CSV import problems).

Common causes, symptoms and fixes

CauseWhat you seeHow to fix it
A new or migrated definition meets older valuesRedirect to Invalid metafield values; Fixes needed on the definitions pageCorrect the values, or loosen a rule stricter than the data needs
A number, date or measurement is outside the minimum or maximumi icon; the value won't saveCorrect the value, or widen an outdated range
Text is too long, too short or fails the regular expressioni icon on the valueEdit the text, or fix a pattern that rejects good values
Single line text isn't a preset choicei icon on each product using the old valuePick a current choice, or add the missing one
The format doesn't fit the type, such as a color without #RRGGBBi icon, or a failed import rowRe-enter the value in the expected format
A list has too many or too few itemsi icon on the listTrim or complete the list, or adjust its limits
A reference points to a product that doesn't exist yet"Value must be a valid product reference" when importingImport the products first, then the metafield values
An invalid value sits in a column you aren't editing"Update the invalid values, then save again"Add the metafield columns to find it
A value is written to a product whose category the definition doesn't cover"Owner subtype does not match the metafield definition's constraints"Set the right product category, or stop writing that field to the product

What does "Owner subtype does not match the metafield definition's constraints" mean?

You usually see "Validation failed: Owner subtype does not match the metafield definition's constraints" during a CSV import, an app sync or an API call. Shopify's Help Center doesn't explain the message, but its wording matches how conditional metafield definitions work. By default a definition applies to every product. Constraints can limit it to a subset, and the only "subtype" Shopify supports is the product category. Shopify's example is a shoe size field that wouldn't apply to sweaters. Category metafields are tied to categories in the same way.

Read the message as: the owner is the product, its subtype is its category, and the definition's constraints don't include that category. To fix it:

  1. Open the product and check its Category. A missing or different category is the most likely mismatch.
  2. Find the metafield the failed row or call was writing, and check whether it is a category metafield or a definition limited to certain categories.
  3. If the category is wrong, correct it and save the product, then write the value again in a second pass.
  4. If the category is right, the field doesn't belong on this product. Remove it from the import file or the app's field mapping.

Treat this explanation as our reading of Shopify's constraint model rather than an official definition, and test it on one product first.

1. Find every affected product

Do this before changing anything, so you can recheck the same records afterward.

  1. Go to Settings > Metafields and metaobjects and select the part of the store, such as Products. Some Shopify guides, such as adding category metafields, still call this area Custom data. Where a Fixes needed message appears, click View invalid metafields. That list is Shopify's own record of what fails.
  2. Hover over a few i icons and group the rows by error. One error repeated across many products usually points to one source: a definition change, an import or an app.
  3. Export the affected products as a backup, using Products you have selected or Products that match your search and filters (Exporting products). Defined product metafields are included in product CSV exports; variant metafields aren't, so note those separately (Using CSV files).
  4. Look for the same bad value outside the error list. For single line text, true or false and several reference types, turn on Filter on the product list and in the Admin API in the definition's Options, then filter Products by that metafield with Add filter + (filtering products using metafields).
  5. Check View unstructured metafields. Values an app saved without a definition get validation only once one exists, and Shopify advises defining only namespaces and keys you recognize, because an app may depend on them (Migrating metafields to a definition).
  6. Pause the source. If a CSV, integration or app wrote the bad values, hold its next run until the fix is agreed, or it will recreate the same errors.

2. Decide whether the value or the definition is wrong

Do not assume the product value is at fault. Fix the value when the definition is right and products contain bad data: a malformed URL, an out-of-range number, or a label that is no longer an allowed choice. Fix the definition when the rule no longer reflects the store: a maximum too low for a new product line, a regular expression that rejects valid codes, or a type that can't hold what the product page needs.

Size charts are a common example. Shopify's pop-up size chart tutorial uses a page reference metafield, and each product's metafield can reference only one page. If some products need more than one chart, forcing them into a single reference creates a future cleanup job; plan the structure first, as in our guide to adding a Shopify size chart.

Category metafields are tied to categories in Shopify's Standard Product Taxonomy. If an attribute you expect is missing or looks wrong, confirm the product's category before working around it. Our guide to Shopify category metafields explains how the category decides which fields a product gets.

3. Fix values safely

Choose one affected product that is easy to inspect, correct its value, save, and confirm the i icon has become a checkmark. Then open the product page in a private window and look at the block that uses the field: specifications, size chart, delivery message or a custom component. This catches what admin can't show:

  • The field saves, but the theme expects a different format.
  • A new value makes a block appear when it should stay hidden.
  • A blank value leaves a heading or label with nothing under it.
  • A reference points to an unpublished or unsuitable item.

When the test looks right, fix the rest with one of three tools:

  • The Invalid metafield values page. Edit the METAFIELD VALUE column directly. Drag across cells or Shift-click to select a range, hold Alt (Windows) or Command (Mac) to pick separate cells, or drag a fill handle down to copy a value. Click Save and repeat until no i icons remain.
  • The bulk editor. Select a defined group of products, click Bulk edit (Shopify's metafields guide calls it Edit products), then Columns, and choose fields in the Metafields section. Shopify supports bulk editing metafields for products, variants, collections and customers, and recommends Chrome, Firefox or Safari, as Microsoft Edge's URL length limit can cause errors. Our Shopify bulk editor guide covers the rest of the workflow and its limits.
  • A CSV import. Product metafield columns use the header format Name (product.metafields.namespace.key), list values are separated by semicolons, and variant metafields aren't supported. With Overwrite products with matching handles selected, a blank cell in an included column clears that value, so follow our product CSV update checklist before uploading.

Work in batches when the field is customer-facing, and check a few product pages from each batch.

4. Fix the definition safely

For custom definitions, Shopify lets you edit the name, description, storefront access, validation rules and pinning from Settings > Metafields and metaobjects (Editing custom metafield definitions). Standard definitions are configured by Shopify and can't be edited.

  • Loosening a rule, such as raising a maximum or adding a choice, can make existing values valid without touching products. Check that the wider rule still blocks the mistake it was meant to stop.
  • Tightening a rule affects values already saved. Shopify's developer guide to managing metafield definitions warns that tightening may fail when existing values break the new constraint, and advises starting loose.
  • Changing the type isn't on the list of editable parts. Shopify's guide to deleting metafields offers Delete field only, which keeps the saved values, and says you can reach them again by migrating them to a new custom definition with the same namespace and key. Values that don't fit the new type become invalid and need fixing or clearing (list of data types).

Treat a type change as a small migration. Deleting is permanent, and Shopify warns that deleting metafields connected to your theme can cause display errors. Export the values, note every theme block and app using the namespace and key, and check the storefront straight after.

Prevent the next validation cleanup

Treat a metafield definition as part of the product data model. Before adding or changing one, document what belongs in it, which products need it, and where customers see it.

  1. Name the use: specification, size guide, care instruction or internal data.
  2. Choose the narrowest type that fits, and a list only when products need several values.
  3. Add validation only when it prevents a real mistake.
  4. Test the field on a product page before importing values across the catalog.
  5. Recheck the storefront whenever an app, theme section or template starts using it.

A regular Shopify metafield audit catches blank and mismatched values before they become the next round of errors.

Frequently asked questions

What causes a Shopify metafield validation error?

A saved value doesn't match its definition's content type or validation rules. It usually appears after a definition is created, migrated or tightened, or after an import, app or integration writes values the definition doesn't accept.

Why won't the Shopify bulk editor save my changes?

"Update the invalid values, then save again" means a selected product or variant has an invalid value, possibly in a column you haven't added. Add the SKU and metafield columns to find it. With many definitions, Shopify suggests fixing metafield errors in the metafield bulk editor first.

Will fixing metafield values change my product pages?

It can. Theme and app blocks read the field's value and format, and Shopify says lists of values connect only to Text or Rich text sections and blocks (displaying metafields). Check a product page after the first fix and after each batch.

Sources