Turn it on
- Open Manual Generation or AutoGen Setup.
- Choose Custom pattern as the code type, or Valid GS1 barcode (UPC / EAN) if you're generating Barcode only.
- Tick Prevent duplicate codes (paid plan).
![The Custom pattern option on the Manual Generation page: the Include product data dropdown, the pattern NOR-[0-9]{6} with an example code and how many codes are possible, the Auto code box, and the Prevent duplicate codes checkbox.](/assets/img/guides/pattern.webp)
What it does
- Manual Generation: scans your catalog first and skips any code already in use.
- Auto Generate: checks each new code before saving it and picks another if it's taken.
- Custom pattern on Auto Generate: tick Add a unique suffix if not unique. If a code is still taken after retrying, SGT adds extra characters instead of skipping the product.
Without that box
SGT's own numbers still don't repeat. What you'd miss is a code typed by hand or added by another app, because SGT only knows about those after checking your store.
Using Shopify? SGT is our app for this: see it on the Shopify App Store (free plan, 4.8 from 53 reviews).
Other code types
Uniquely Generated Number makes a unique 14-digit number and Shopify Variant ID uses an ID only that variant has. For Advanced SKU, keep Auto Number in the layout, leave Remove Numbers unticked (so 2XL and 3XL stay different), and leave Same SKU for all variants off.
Already have duplicates?
Prevention only covers new codes. For the ones already there, find and fix them with Find duplicates.
Prefer video? Watch the 90-second SGT tour on YouTube.
Frequently asked questions
Does Shopify stop me from using the same SKU twice?
No. Shopify accepts the same SKU or barcode on many variants without a warning, so check before you save, or let an app check.
How do I stop my app creating duplicate barcodes when other people also add codes by hand?
Tick Prevent duplicate codes. SGT then checks your whole store, so codes typed by hand or added by other apps are skipped too.
Will duplicate prevention slow down generation?
A manual run scans your catalog first, so a big store waits a little longer before it starts. New products get a quick check on each code.