Skip to main content

How to update only some fields of Shopify products and leave the rest unchanged

Change one field of existing Shopify products, such as Body HTML, Title, price, tags, or a metafield, and leave everything else unchanged.

Goal: Change one field of your existing products, such as the description (Body HTML), Title, Tags, compare-at price, or a metafield, and leave all the other data as it is. You do this with a small file that has only the identifier, the Command column, and the column that you change.

Prerequisites:

  • You have Altera installed on your Shopify store

  • You have the ID or Handle of each product, or the Variant ID or Variant SKU of each variant (an export of your products has all of these)

Step 1 - Choose the column that identifies each row

Use one identifier column. Which one you use depends on the field that you change.

You change

Identifier column

Rows in the file

A product field, such as Body HTML or Tags

ID or Handle

One row per product

A variant field, such as Variant Compare At Price

Variant ID or Variant SKU

One row per variant

A product metafield

ID or Handle

One row per product

A variant metafield

Variant ID or Variant SKU

One row per variant

Do not add a second identifier. For example, if a file has both ID and Handle, Altera finds the product by its ID and then changes the handle to the value in the row. If a file has both Variant ID and Variant SKU, Altera finds the variant by its ID and then writes the SKU in the row to the variant, and a blank Variant SKU cell removes the SKU.

Step 2 - Create a file with only the columns that you need

Put the identifier column, a Command column, and the column that you want to change in the file. No other column is required: a file without variant columns does not change variants, options, prices, or inventory. The examples below show the three common files.

Set Command to UPDATE in each row. With UPDATE, a row that matches no product is skipped and reported with IMP002. If you leave out the Command column or leave the cell blank, Altera uses MERGE, and MERGE tries to create a new product when a row matches no product.

Fill in every cell of the column that you change. Most columns, such as Title, Body HTML, Vendor, and Variant Price, keep the existing value when the cell is blank. A few columns, such as Variant Compare At Price and Variant SKU, remove the value. For the full list, see How to clear Shopify fields with an import.

Save the file as products.csv. Altera uses the file name to choose the import type.

Step 3 - Upload the file and start the import

In Altera, click New import, upload your file, check that it shows as a Products import, and click Start import.

To check the result first, import a file with one or two products. See Import best practices.

Outcome

The results page lists the updated products. Open a product in the Shopify admin to check that the field has the new value and that the rest of the product did not change. Rows that matched no product show as skipped with the code IMP002.

Example: Update only Body HTML or Title with ID or Handle and no variant columns

This file changes only the description of two products. It has one row per product and no variant columns, so the variants, prices, and inventory stay unchanged. Each row finds the product by ID.

ID

Command

Body HTML

8012345678901

UPDATE

<p>Soft linen apron.</p>

8012345678902

UPDATE

<p>Heavy canvas apron.</p>

This file changes only the title of two products. Each row finds the product by Handle.

Handle

Command

Title

linen-apron-sage

UPDATE

Linen Apron, Sage

linen-apron-indigo

UPDATE

Linen Apron, Indigo

Title needs an ID or Handle column in the file. In a file with Title and no ID or Handle, Altera uses the title to find the product, so it cannot change the title.

Tags adds to the existing tags by default. To replace all the tags of a product, add a Tags Command column and set it to REPLACE. See Tags Command.

Example: Update only a variant field with Variant ID or Variant SKU

This file changes only the compare-at price of two variants. The file has no ID, Handle, or Title column, so Altera finds each product through its variant.

Variant SKU

Command

Variant Compare At Price

APR-LIN-SG

UPDATE

45.00

APR-LIN-IN

UPDATE

45.00

To use the variant ID, replace the Variant SKU column with a Variant ID column that has values such as 47285563104277. Each row changes only its own variant. The other variants of the product do not change.

Keep these rules in mind:

  • The same SKU on several products: Altera updates all of them (see PRD110). To update only one, use Variant ID.

  • The same SKU on several rows: Altera applies only the first row.

  • Changing Title in the same file: Name the identifier column Variant SKU [ID], because otherwise the Title column identifies the product. See How imports find existing Shopify products.

  • Variant columns with ID or Handle: On a product with several variants, the row must also have a Variant ID or Variant SKU, or the product fails with PRD009. Command UPDATE protects only the product: Altera tries to add a new variant for a Variant SKU that the product does not have. To prevent this, add a Variant Command column and set it to UPDATE.

Example: Update only a metafield with ID or Handle and no variant columns

This file changes only one metafield of two products. The other metafields, the variants, and the prices stay unchanged.

Handle

Command

Metafield: custom.care_guide [single_line_text_field]

linen-apron-sage

UPDATE

Wash cold

linen-apron-indigo

UPDATE

Wash warm

For a metafield of a variant, use Variant ID or Variant SKU as the identifier and name the column Variant Metafield: custom.care_guide [single_line_text_field].

A blank metafield cell keeps the existing value, unless you turn on the Delete metafields with blank cells import option. See Metafields.

Next steps

Did this answer your question?