Product Categorisation With AI: Fixing Shopify Taxonomy at Scale

Coding Liquids tutorial cover featuring Sagnik Bhattacharya for Product Categorisation With AI: Fixing Shopify Taxonomy at Scale.
Coding Liquids tutorial cover featuring Sagnik Bhattacharya for Product Categorisation With AI: Fixing Shopify Taxonomy at Scale.

Export your products, give an AI assistant the product details plus a shortlist of valid categories from Shopify's Standard Product Taxonomy, run it in batches of 30 to 50 rows, check every answer against the official list with a lookup formula, audit a sample by eye, then re-import only the handle, title and category columns.

The check matters more than the prompt. An assistant asked to "categorise these products" will cheerfully invent a plausible-sounding breadcrumb that does not exist in the taxonomy, and Shopify will not accept it. Treat the AI as a fast first-draft reader of product names, and the taxonomy file as the only source of truth for what a category is called.

Follow me on Instagram@sagnikteaches

What the category field does, and why a bulk fix is worth the effort

Shopify's help centre describes the product category as a field filled from its Standard Product Taxonomy, and says every product should have one. A product without a category is saved as "uncategorised". That includes products created through a CSV file or an app, which is exactly how most large catalogues arrive.

Connect on LinkedInSagnik Bhattacharya

The category is more than a label. According to the same page it adds category metafields (attributes such as size, colour, fabric or neckline that belong to that kind of product), helps you build collections and filter your product list, makes selling on channels such as Facebook and Google easier, and feeds the tax calculation if you use Shopify Tax. It also drives the reasons offered when a customer returns an item, so correct categories make your returns analytics meaningful.

Subscribe on YouTube@sagnikteaches

Two further rules shape the whole job. A product has exactly one category and one product type. The category must come from the standard list; the product type is your own free text. So the question is never "what groupings do we want?" (that is collections and tags) but "which one entry on Shopify's list best matches what this product is mainly for?"

The Complete Excel Course with AI Integration thumbnail

The Complete Excel Course with AI Integration

From formulas and pivot tables to Power Query, DAX, VBA and AI with Copilot, ChatGPT and Claude — hands-on from the first lesson.

By Sagnik Bhattacharya and Virginia Thorn, Primetime Emmy Award winner

Buy now

An illustrative job: a nursery's uniform and equipment shop

Picture a childcare nursery group that runs an online shop for parents and for other settings. It sells uniform, bags, craft supplies, wall clocks and storage. The catalogue came in from a supplier spreadsheet and has 2,400 products, of which 1,310 show as uncategorised and another 160 carry a category that Shopify's suggestion disagrees with. Titles are a mix of tidy ("Nursery polo shirt, navy, ages 3-4") and terse ("PLAYMAT 120 FOAM GRY").

The owner runs all 2,400 rows rather than only the 1,470 problem ones, so the products that already carry a category get a second opinion too. The plan has six stages. Roughly: three hours of preparation, three to four hours of batch runs (60 batches of 40 rows at about three minutes each), two hours of checking, then a short import. It is a day's work, not a week's, and it can be done by one person.

Stage 1: use Shopify's own suggestion first

Shopify generates an AI-powered category suggestion from a product's name, description and images, and for products moved off retired categories it offers a suggestion you can accept or reject. If you have a hundred products with a confident, correct suggestion sitting on screen, accept those. It costs nothing and keeps the work inside the admin. Your assistant job is the remainder: the products that still say uncategorised, plus the ones whose suggestion is plainly wrong.

Before you begin, decide how you will protect yourself. Keep an untouched copy of the export, named with the date. If the bulk change goes badly, that copy is how you put things back, because a CSV import cannot delete products but it can overwrite values.

Stage 2: export and prepare the input

Export the products as a CSV from the admin. Keep these columns for the AI: URL handle, Title, Description (stripped of HTML if it is long), Vendor, Type, Tags, and the existing Product category. Remove prices, costs and everything else; the model does not need them and fewer columns means fewer places for it to wander. Use one row per product, not one per variant: variants repeat the handle and add nothing for categorisation.

Next, build the allowed list. Shopify publishes the taxonomy openly, and its help page links to it, with each category available as a breadcrumb (such as Apparel & Accessories > Clothing > Clothing Tops > Shirts) and as an ID. Download the full list into a second sheet, with a column for the breadcrumb and one for the ID. This is your lookup table. The tutorial does not reproduce it because the list changes between releases; use the current one from Shopify.

The full list is long, so do not paste it into every prompt. Make a shortlist instead. A nursery shop touches perhaps 40 to 60 branches of the tree: clothing, bags, art and craft supplies, furniture, storage, toys and so on. Filter the lookup table to the branches that plausibly match your range and paste only those into the prompt. A 60-item shortlist is short enough to stay in the model's attention for the whole batch, and it makes wrong answers easy to see.

Stage 3: the batch prompt

Ask for a strict format you can paste back into a sheet. Give the AI an escape hatch ("none fits") so it does not force a poor match, and ask for a confidence flag you will use later in the audit.

You are assigning each product to one category from the allowed list below.
Rules:
- Choose ONLY from the allowed list, copied exactly. Never invent or shorten a category.
- Pick the category that matches the product's main function, not its accessories.
- If no allowed category fits, answer NO MATCH.
- Give a confidence of HIGH, MEDIUM or LOW. Use LOW if the title is ambiguous.

ALLOWED CATEGORIES (breadcrumb | id):
[paste your 60-line shortlist here]

PRODUCTS (handle | title | vendor | type | tags):
[paste 40 rows here]

Return one line per product: handle | category breadcrumb | confidence | reason (max 10 words).

An illustrative reply for three rows looks like this.

nursery-polo-navy-3-4 | Apparel & Accessories > Clothing > Clothing Tops > Shirts | HIGH | School-style polo shirt
playmat-120-foam-gry | [a play-mat entry from the shortlist] | MEDIUM | Foam floor mat for play
wall-clock-alarm-bell | Home & Garden > Decor > Clocks > Alarm Clocks | LOW | Clock with alarm and bell

The first row is exactly what you want. The second is fine but note the MEDIUM: "PLAYMAT 120 FOAM GRY" could be a tumbling mat or a floor tile. The third is a case Shopify's own page speaks to directly: choose the category from the product's main function, so a clock with other features is classed by what it mainly does. Here the assistant has put a bell-style clock under alarm clocks with LOW confidence, which is correct behaviour; a person looks at that one.

Stage 4: check every answer with a formula, not your eyes

Paste the output into a sheet and split it into columns on the pipe character. Then run the check that catches fabrications.

  1. Add a column that looks the breadcrumb up in your taxonomy sheet. In Excel or Google Sheets, =IFERROR(XLOOKUP(C2, Taxonomy!A:A, Taxonomy!B:B), "NOT IN LIST") returns the ID if the breadcrumb exists and the words NOT IN LIST if not. Where XLOOKUP is not available, use VLOOKUP with an exact match.
  2. Filter the column to NOT IN LIST. Those are invented, mistyped or shortened categories. Feed just those rows back with the instruction "your answer was not in the list; choose again".
  3. Count the NO MATCH rows. They are usually products that sit outside your shortlist (a gift voucher, a donation). Handle them by hand or widen the shortlist for that group.
  4. Check for duplicate handles. Two rows with the same handle and different categories mean the export had variants you should have collapsed.
  5. Count the rows that came back against the rows you sent, batch by batch. A batch of 40 that returns 38 has dropped two products, and they stay uncategorised unless you notice. Match on handle to find which ones and send them again.

For the nursery shop, the first run might return 2,310 rows for the 2,400 sent: 2,185 valid, 93 NOT IN LIST and 32 NO MATCH, with 90 missing altogether. The invalid and unmatched rows are a normal result, not a failure, and rerunning the 93 usually fixes most of them in one pass. The 90 missing rows are the quieter fault, which is why the row count sits in the checklist above.

Stage 5: audit a sample

A lookup proves the category exists; it does not prove it is right. Only a person can say whether "Foam floor mat" belongs under play equipment or flooring. So audit a sample before you import.

Pick about 100 rows rather than reading all 2,400. Take them from across the result, not the first 100: sort by category and take a few from each one the AI used, plus every LOW-confidence row up to a limit of 60. Mark each sample row right or wrong, and note why each wrong one went wrong (a vague title, a missed variant, a category that was too general). With 100 rows, an observed error rate of 5 per cent has a margin of roughly plus or minus four percentage points, so 5 wrong in 100 supports "the true error rate is probably under 10 per cent", not "exactly 5 per cent". Even a sample with no errors at all supports only "probably under 3 per cent", never "there are no errors".

Set the acceptance rule in advance. For example: if more than 5 of 100 are wrong, or any wrong rows share a pattern, fix the prompt or shortlist for that group and rerun it. If the wrong rows are scattered with no pattern, accept and correct them individually. A written rule stops you rationalising a poor result at four in the afternoon.

For high-stakes products, widen the check. If you use Shopify Tax, the help page says the category determines the rate at which a product is taxed, so any product where two candidate categories might carry different rates should be reviewed by a person in full. Ask your accountant about doubtful items rather than relying on a model's guess.

Stage 6: apply it in bulk without damaging anything else

This is where people lose data. Shopify's import has an "Overwrite products with matching handles" option. With it ticked, rows with a matching handle update the existing product, and blank cells in columns you include clear the existing values. Columns you leave out of the file are not touched. Updates require the URL handle and Title.

So build a thin file: three columns only, URL handle, Title and Product category. Use the column header exactly as it appears in a fresh Shopify export. Give the category as the breadcrumb or as the ID but never both in one file. Make sure the title in your file matches the existing one, and do not include the other columns, otherwise a blank price or description in your sheet could blank the live one.

  1. Import five products first, including one with category metafields already filled, one with several variants and one that was uncategorised.
  2. Open each in the admin. Confirm the category took, the variants survived and the metafields behave as described in the help page: values that were set are kept, empty ones are not carried across.
  3. Only then import the rest, in files of a few hundred rows so any error is easy to trace.

Other cases that behave differently

Products that are several things at once

A gift hamper of craft supplies, or a "back to nursery" bundle holding a bag, a water bottle and a shirt, has no single main function. Pick the item that carries the price, or the category you most want to filter by, and record the rule. Do not let the AI choose differently on different days; put the rule in the prompt ("for kits, use the category of the highest-priced component").

Titles in a supplier's shorthand

Supplier titles like "ST 16 PK ASST" give the model nothing. Add the supplier's own product group column from the original spreadsheet if there is one, since a group such as "stationery" narrows the options sharply. If you are still cleaning that sheet, the tutorial on turning a supplier sheet into an import file comes first.

A catalogue built from photos

If a shop has products that exist only as photographs, such as a second-hand stock room, the model needs a written title before it can categorise. Cataloguing from photos covers building those records.

A care agency's equipment store

A care agency selling hoists, slings and bed rails will find that categories matter for a different reason: customers search by need, not by product word. Categorise first, then add collections named after needs ("getting out of bed") that cut across categories. The category stays one-to-one; the collection is where you express the customer's language.

After the categories: the attributes they open up

Once a product has a category, Shopify offers the category metafields for it. For a shirt, the help page lists size, neckline, sleeve length type, top length type, age group, fabric, target gender, clothing features and colour, each with default entries you can use as they are or rename. Filling these is the natural second pass, and it is a different job from categorising: the model reads the title and description and proposes values such as fabric or age group, you check them, and you import them.

Do not mix the two passes. Categories first, imported and verified, then attributes. If you ask for both at once and a category is wrong, every attribute under it is wrong too, and you will not know which error came first. For the nursery shop the second pass might cover 700 clothing products and take about an hour of checking, because attributes such as age group are often already in the title ("ages 3-4").

One more channel detail belongs on your list. Shopify's page says that if your customers check out directly on Instagram or Facebook, you must provide Google Product Categories for tax reasons even when you hold a standard Shopify category. If you already have Google Product Categories on your products, Shopify maps them to the standard taxonomy when the values match Google's English names or IDs. Check which situation you are in before you replace the old values, because a mismatch there is a quiet source of rejected products in a feed.

What went wrong in a test batch

A sensible dry run shows how things fail. In an illustrative first batch of 40 rows, three failures stood out. Two categories came back shortened ("Clothing Tops" rather than the full breadcrumb), which the lookup caught immediately. One "PLAYMAT" row came back as a clothing category because the title was close to "playsuit" in the vendor's list, which the lookup did not catch because the category is valid. Only the audit would have found it, and the fix was adding "Type" to the input so the model could see that the supplier had filed it under "floor".

The lesson is that valid does not mean right, and the audit exists for the second kind of error. When you rerun, change one thing at a time (more columns, a tighter shortlist, a clearer rule) so you know which change fixed it.

Costing the job against doing it by hand

A quick sum shows when the AI route pays. Doing 1,310 uncategorised products by hand means opening each one, searching the category picker and saving: at roughly 45 seconds a product that is about 16 hours. The AI route in this example is about 3 hours of preparation, 3 to 4 hours of batch runs, 2 hours of checking and an hour of import, so around 9 hours, and the checking part does not shrink with catalogue size. Under 150 products, do it by hand; the set-up costs more than the saving. Past 500, the batch approach clearly wins, and past 2,000 it is the only sensible choice.

Use a paid chat plan or an API run only if you want; a free assistant plan may cap the number of messages a day, which stretches 60 batches over a few sessions. Whichever you use, do not paste customer data: product rows contain none, which is one reason this job suits an assistant well.

A repeatable routine for new products

Once the backlog is clear, keep it clear. Each time a supplier sheet is imported, filter the new rows to anything uncategorised, run the same prompt on that small batch, check with the same lookup, and import the three-column file. If you already use AI for product descriptions, categorise first: the category tells you which attributes to mention. Review the taxonomy release notes now and then, since Shopify warns that categories you previously used may have been modified or replaced and some products fall back to uncategorised.

Finally, keep a short log: the date, the number of rows, the invalid rate and the sample error rate. Three entries in, you will know whether the prompt is good enough to trust with less checking, which is the only honest basis for reducing the audit.

Questions about bulk-categorising Shopify products

Does Shopify already categorise products with AI?

Yes. When you create a product with a name, description and images, Shopify generates an AI-powered category suggestion, and products from older categories may show a suggestion to accept or reject. Use that first. An outside assistant is for the leftover products, the ones Shopify left as uncategorised or got wrong.

Can I put my own category names in the Product category column?

No. The category must be a predefined entry from Shopify's Standard Product Taxonomy, given as either its breadcrumb or its ID in the CSV, not both. Your own groupings belong in collections, tags or the separate product type field.

Will a category change wipe my existing product data?

Changing a category keeps category metafields that already hold values or are connected to variant options. Metafields without values are not carried across automatically. Test the change on a handful of products with metafields before you apply it to thousands.

How big should the audit sample be?

For a few thousand products, check about 100 chosen across all the categories the AI used, plus every product it marked low confidence. If more than a handful are wrong, fix the prompt and rerun that group before importing.

Further reads

Sources: Shopify help centre pages on Shopify's Standard Product Taxonomy and on importing products with CSV files.

Want your catalogue categorised without the clean-up weekend?

On a 1:1 call we can look at how your products are named now, decide what to hand the AI and what to check by eye, and plan a bulk update that is safe to reverse.

Book a 1:1 call with me