Add variants with metafields

You can add variants by connecting a variant option to a category or product metafield of metaobject reference (list) type. All compatible metafields have the following icon next to them: .

When variant options are connected to metafields, it makes data reusable across your store and content edits are much easier. For example, if you need to change the name of your color metaobject entry black to graphite, then you can edit the entry in the context of your product detail page or from the Content > Metaobjects page in your admin. The color will be updated on every product it’s connected to.

Connect a variant to a product or category metafield

Steps:

Desktop
  1. From your Shopify admin, go to Products
  2. Click the product that you want to edit
  3. In the Variants section, click + Add options like size or color
  4. If a compatible category or product metafield is available to connect to, then select it. The option values are automatically filled with any entries you have added to the metafield. You can select more option values or create new ones
    • Alternatively, click on a compatible metafield and click on the datasource icon ⛁ to connect to option
  5. Optional: If you want to add custom option values, then click Edit, and then click Add new entry. Fill out the entry fields, and then click Save
  6. Click Save to save the product
iPhone
  1. From the Shopify app, go to Products > All products.
  2. Tap a product.
  3. In the Variants section, tap + Add options like size or color.
  4. If a category or product metafield is available to connect to, then tap to select it. The option values are automatically filled with any entries you have added to the category metafield. You can select more option values or create new ones.
  5. Optional: If you want to add custom option values, then type the option in the Add value field. Tap + Add {option name}, fill out the entry fields, and then tap Save.
  6. Tap Save to save the product.
Android
  1. From the Shopify app, go to Products > All products.
  2. Tap a product.
  3. If you have no variant options, then in the Variants section, tap + Add options like size or color. If you have variant options, then in Options section, tap Edit, and then tap Add option.
  4. If a category or product metafield is available to connect to, then tap to select it. The option values are automatically filled with any entries you have added to the category metafield. You can select more option values or create new ones by tapping Add value, and then tapping the values that you want to add.
  5. Optional: If you want to add custom option values, then type the option in the Add value field. Tap + Add {option name}, fill out the entry fields, and then tap .
  6. Tap to save the product.

Disconnect a variant from category metafields

Steps:

Desktop
  1. From your Shopify admin, go to Products](https://admin.shopify.com/products)
  2. Click the product that you want to edit.
  3. In the Variants section, click Edit next to the option that you want to disconnect from your category metafield.
  4. Click the category metafield name, and then click Disconnect. The option is disconnected from the metafield and turned into a custom option.
  5. Click Save to save the product.
iPhone
  1. From the Shopify app, go to Products > All products.
  2. Tap the product that you want to edit.
  3. In the Options section, tap Edit, and then tap the option that you want to disconnect from your category metafield.
  4. Tap Connected to metafield, and then tap Disconnect.
  5. Tap Save to save the product.
Android
  1. From the Shopify app, go to Products > All products.
  2. Tap the product that you want to edit.
  3. In the Options section, tap Edit, and then tap the option that you want to disconnect from your category metafield.
  4. Tap Connected to metafield, and then tap Disconnect.
  5. Tap Save to save the product.

Migrate existing variant options to category or product metafields

If you've already created a product with variant options, then you can migrate your values to category or metafields and quickly generate multiple new variant combinations. If you use category or product metafields to create your variant options, then you can edit variant option names in a single location and the names update wherever that category metafield is connected.

For example, if you currently offer three sizes (Small, Medium, and Large) and two colors (Red and Blue), and you want to add a third color Yellow, then this method will create the 3 possible sizes of yellow variants at one time.

Connect the category or product metafield to an existing option by clicking the dynamic source icon .

Can’t find the answers you’re looking for? We’re here to help.