k-sync
Back to blog

Shopify metafields: how to migrate custom WooCommerce product data (2026)

WooCommerce custom fields (ACF, WooCommerce Custom Product Fields) don't migrate automatically. This guide covers how to map WooCommerce custom data to Shopify metafields during migration.

·By k-sync
6 min read · 1,116 words

WooCommerce stores often accumulate custom product data beyond the standard fields: material specifications, nutritional information, technical datasheets, care instructions, warranty details, certifications. This data is stored in WooCommerce as custom fields (via ACF, WooCommerce Custom Product Fields plugin, or direct post meta), and it won't migrate automatically to Shopify.

In Shopify, custom product data lives in metafields — a flexible key-value storage system for any data that doesn't fit Shopify's standard product schema. This guide explains how to map and migrate your WooCommerce custom data to Shopify metafields.

What is WooCommerce custom product data?

Custom product data in WooCommerce can come from:

All of this is accessible via the WooCommerce REST API (products endpoint returns meta_data) or the WordPress REST API.

What are Shopify metafields?

Shopify metafields are custom data fields that can be attached to products, variants, collections, customers, and orders. They have:

Example metafield: custom.material = "100% organic cotton"

Metafield types available in Shopify

TypeBest forExample
Single line textShort labels, codes, model numbersMaterial: "Cotton", Model: "XJ-400"
Multi-line textParagraphs, multi-item listsCare instructions, warranty text
Rich textHTML content (formatted)Technical specifications with headers
IntegerWhole numbersStock depth, pieces per box
DecimalDecimal numbersWeight in grams, dimensions
True/False (Boolean)Yes/no flagsIs organic, Is gluten-free
DateDatesHarvest date, release date
URLLinks to documents or resourcesPDF datasheet, spec sheet URL
FileUploaded files (Shopify-hosted)User manual PDF, size guide image
List of…Multiple values of any above typeList of certifications, list of compatible models

Step 1: Inventory your WooCommerce custom fields

Before migrating, get a full list of custom fields in use:

Via WooCommerce REST API

Fetch a product and look at the meta_data array:

GET /wp-json/wc/v3/products/123

{
  "meta_data": [
    { "id": 1, "key": "_material", "value": "cotton" },
    { "id": 2, "key": "_care_instructions", "value": "Hand wash cold" },
    { "id": 3, "key": "_acf_weight_grams", "value": "350" }
  ]
}

ACF fields often have underscore-prefixed keys like _field_name or use prefixes like _acf_. WooCommerce internal fields also use underscore prefixes (e.g., _price, _sku) — filter these out, as they're already handled by standard migration.

Build an inventory spreadsheet

Collect all custom field keys used across your products:

Be ruthless: many stores have accumulated custom fields over years that are no longer used or relevant. Now is a good time to decide what's worth migrating vs. what can be abandoned.

Step 2: Define Shopify metafield definitions

Before importing metafield values, create metafield definitions in Shopify. Definitions give metafields a name, type validation, and make them available in the theme editor.

In Shopify Admin → Settings → Custom Data → Products → Add definition:

Create one definition per WooCommerce custom field you're migrating. Definitions also make metafields available in the Shopify theme editor (via Online Store 2.0), so you can display them on product pages without code.

Step 3: Display metafields in your Shopify theme

How metafields are displayed depends on your theme:

Online Store 2.0 themes (Dawn, Refresh, most themes from 2021+)

In the theme editor, you can add metafield blocks to product pages directly — no code required:

  1. Go to Online Store → Themes → Customize
  2. Open a product page template
  3. Add a "Text" block or "Collapsible row" block
  4. Set the content source to a metafield (e.g., custom.material)

Older themes or complex layouts

Use Liquid to output metafields:

{% if product.metafields.custom.material %}
  <p>Material: {{ product.metafields.custom.material.value }}</p>
{% endif %}

Step 4: Migrate metafield values via the Shopify API

After creating definitions and migrating products, populate metafield values via the Shopify Admin API.

Option A: Shopify metafields endpoint (per-product)

POST /admin/api/2024-01/products/{id}/metafields.json
{
  "metafield": {
    "namespace": "custom",
    "key": "material",
    "value": "100% organic cotton",
    "type": "single_line_text_field"
  }
}

Option B: metafieldsSet mutation (GraphQL bulk)

For large catalogs, the GraphQL metafieldsSet mutation can set multiple metafields across multiple products in one operation:

mutation metafieldsSet($metafields: [MetafieldsSetInput!]!) {
  metafieldsSet(metafields: $metafields) {
    metafields { id key value }
    userErrors { field message }
  }
}

With input of up to 25 metafield objects per call. For 1,000 products × 5 metafields each = 5,000 values — takes ~200 GraphQL calls.

Option C: Shopify CSV import (limited)

Shopify's standard CSV product import supports metafields via the "Metafield: namespace.key" column format. This works for simple text metafields but has limitations on type support.

Column format: Metafield: custom.material [single_line_text_field]

Handling WooCommerce product attributes vs. custom fields

WooCommerce has two systems that are often confused:

For non-variant product attributes that you display in a "Product details" table on WooCommerce, the best Shopify equivalent is either:

What k-sync supports for custom data migration

k-sync's WooCommerce import captures meta_data from the WooCommerce API and stores it in the raw sourceData JSONB field per product. During migration:

Automated custom field → metafield mapping (select a meta_data key and assign it to a Shopify metafield namespace/key) is on the k-sync roadmap for a future release. For the current version, metafield population after product migration can be done via the Shopify API using the product IDs returned by the push process.

Migrate your store with k-sync

Connect your WooCommerce store, validate your products, and push to Shopify in minutes. Free for up to 50 products.

Get started free

Related reading

Browse all migration guides