Notes / Article
Merging duplicate products without losing metafields
A safe merge preserves the record that merchants cannot see at a glance: metafields, media context, variants, inventory decisions, and the old product URL.
Two products can look identical in the Shopify admin and still carry different data. One may have the current description while the other has the useful metafields. One may own the better images while inventory is recorded against the other product’s variants.
A merge is therefore not a delete with a copy step. It is a controlled reconciliation between a product that will remain and a product that will be archived.
The preview is part of the merge. If the operator cannot see what wins, what moves, and what remains unresolved, the operation is not ready to run.
What a naive merge drops
The product title and description are the visible layer. The harder data sits behind them:
- Product metafields used by themes, integrations, or internal workflows.
- Variant identifiers, prices, options, weights, and media associations.
- Image alt text and the order in which product media appears.
- Inventory associated with inventory items and locations.
- Search and campaign links that still point at the losing product’s handle.
- App-owned state keyed to a Shopify product or variant ID.
The last item is especially important. A metafield can be copied, but an external system may still hold the archived product ID. A catalogue merge cannot silently repair every downstream integration.
| Data area | Default decision | Operator check |
|---|---|---|
| Product metafields | Copy missing values; flag conflicts | Which value is authoritative? |
| Media | Preserve useful assets and alt text | Are any images duplicates? |
| Variants | Recreate or map intentionally | Do option combinations collide? |
| Inventory | Reconcile by location | Is quantity addition valid? |
| Redirects | Point the old path to the survivor | Does the target handle resolve? |
| Losing product | Archive after verification | Can the change be inspected later? |
Order is the safety mechanism
The merge plan should resolve dependencies before it changes product state. A practical order is:
- Select the surviving product.
- Compare product and variant metafields.
- Plan media and variant changes.
- Reconcile inventory per location.
- Verify the resulting product record.
- Create the required redirect for the old product path.
- Archive the losing product.
Archiving comes last. It keeps the source record available during review and avoids turning a recoverable mismatch into an immediate deletion.
Metafields need conflict rules
Copying only empty values is safe but incomplete. Overwriting every value is complete but unsafe. A merge plan needs a third state: conflict.
{
"namespace": "catalogue",
"key": "material",
"survivor": "recycled steel",
"candidate": "stainless steel",
"decision": "review"
}
The review decision is not an error. It is the correct result when two populated values disagree and the catalogue does not contain enough information to choose one.
Variants and inventory are linked, not interchangeable
A product variant refers to an inventory item, and inventory levels belong to locations. That means a product-level quantity does not describe the full state.
Adding two quantities may be correct when the products represent the same physical stock recorded twice. It may be wrong when each product represents a distinct batch or when one location is a fulfilment buffer. Duplicate Merger can present the records together, but the operator still decides what the combined inventory should mean.
Use a location-level comparison rather than a single total:
Location Survivor Candidate Proposed
Vilnius 12 0 12
Kaunas 0 8 review
Third party 4 4 review
The word review is useful here. It prevents arithmetic from pretending to be a business rule.
Media carries context
Image bytes are only part of a product’s media record. Alt text, position, variant association, and duplicate detection all affect the resulting page. The safe process preserves those relationships before it archives either source.
Verify before archive
The final review should compare the proposed survivor with both original records. It should show counts and differences, not a generic confirmation message.
Check the following before the archive action becomes available:
- All intentional metafield conflicts have a decision.
- Variant option combinations are unique on the survivor.
- Inventory has a location-level result.
- Media order and alt text are retained where selected.
- The redirect points to the survivor’s current handle.
- The losing product remains recoverable through Shopify’s archived state.
The correct merge produces one maintainable product record and an audit trail of the choices that created it. Duplicate Merger supports that process by making the plan visible before it changes catalogue data.
Related app
Duplicate Merger
Finds duplicate products across the catalogue and merges them while preserving the records selected in review.