Duplicate product IDs in a CSV: what to do
Find repeated product IDs, decide which record to keep, and clean a CSV without deleting valid variants or losing the original data.
Your product CSV has the same ID on more than one row, and you need to know whether those rows are mistakes. Deleting every repeated ID can remove a valid product variant, a newer update, or information you still need.
Use the CSV Editor to sort the file, inspect repeated IDs, and edit the records in your browser. First decide what one ID is supposed to identify in your catalog, then remove only the records that break that rule.
Find and review duplicate IDs
- Make a copy of the original CSV so you can restore it if you remove the wrong row. Open the copy in the CSV Editor.
- Find the column that contains the product ID. Sort the rows by that column so matching values appear next to each other. Check the column heading and a few known products to make sure you chose the right field.
- Compare the rows with the same ID across the other columns. Look at product name, variant, status, price, and update date if those fields are present. Note whether the rows are identical or contain different information.
- Decide which row should remain before editing. Use your catalog rules or the current source of truth, such as the latest approved product export. Do not keep a row just because it appears first or last after sorting.
- Edit or remove only the rows that violate your rule. Use the editor's remove-duplicates feature only after checking what it treats as a duplicate. Then review the corrected rows and save a separate corrected CSV.
If you need to remove repeated rows more generally, see how to remove duplicate rows from a CSV file. Product IDs need an extra check because two different rows can share an ID without being identical.
What the repeated IDs mean
The rows match in every field
These may be accidental copies, especially if they came from a repeated import or a file merge. Compare the full rows, including fields you do not usually display. If every value is the same and your system expects one row per product, keeping one copy is usually appropriate. Keep the original file until the cleaned CSV has passed your next import or review.
The ID matches but product details differ
This is not necessarily a duplicate row. One row may contain an old price and another a newer price, or the same ID may have been assigned to two different products. Check the update date, catalog system, or approved source before choosing a record. If the details describe separate products, correct the IDs instead of deleting either product.
The rows describe product variants
A parent product may have several sizes, colors, or other variants. In some catalogs, the parent product has one shared ID while each sellable variant has its own SKU or variant ID. Confirm which field is expected to be unique. If your import requires a unique ID per variant, use the variant identifier rather than removing valid rows with a shared parent ID.
Values look alike but are not the same
Check for leading or trailing spaces, different capitalization, and leading zeros. For example, 00125 and 125 may be different identifiers, even if a spreadsheet displays them similarly. Do not remove zeros or change capitalization unless the system that owns the IDs says those differences do not matter.
An ID is blank or missing
A blank ID is a separate data problem, not a duplicate. Find out whether the product should have an ID, then correct it from a trusted catalog record. Avoid giving a blank row an invented value just to make the list look complete.
How to fix the CSV safely
- Keep an untouched copy. Save the original file separately before making changes. This gives you a way back if a deletion or edit affects an import unexpectedly.
- Confirm the uniqueness rule. Check whether each row represents a product, a variant, or a parent product. If another system will import the CSV, use that system's required key, such as a product ID or variant SKU.
- Choose the correct record. Compare the conflicting values with the source of truth. A newer timestamp can help, but it is not proof by itself if records were merged from different systems.
- Correct formatting carefully. Remove accidental spaces only when you have confirmed they are not part of the identifier. Preserve leading zeros and letter case unless the catalog rules allow you to change them.
- Remove only confirmed duplicates. If two complete rows are identical and one is unnecessary, remove one copy. Do not rely on a general duplicate-removal action to identify repeated IDs unless its behavior matches the decision you made.
- Check the cleaned file again. Sort by ID once more and review each repeated value. Also confirm that the header row, product count, and important fields are still present before using the new CSV.
Prevent the same problem in future exports
Decide which field must be unique and check it before combining exports or importing new records. If products have variants, keep the parent ID and variant ID in separate columns rather than treating them as interchangeable. If you merge two lists, compare their source and update dates first, and do not assume that matching names mean matching products.
A clean CSV is not just a file with no repeated values. Each row needs to represent the right product, and each identifier needs to follow the rules of the catalog that will use it.
