Skip to content
Tutorials Center
My learning

Topics

Lesson 25 of 40 ยท Growth, SEO and Analytics

SEO for Online Shops

Technical SEO for online shops: clean URLs, canonicals for variants and filters, faceted navigation, Product structured data, sitemaps, out-of-stock pages and Core Web Vitals.

A shop that nobody can find sells nothing. Paid ads work, but they stop the day you stop paying, while organic search keeps sending shoppers who already want what you sell. Search engines are not magic: they crawl URLs, read the HTML, and decide which page best answers a query. As a developer you control most of what they see, and a shop makes that harder than a blog because one product can appear under dozens of URLs.

This lesson covers the technical side of shop SEO: URLs, duplicates, filters, structured data, sitemaps, stock changes and speed. Copywriting and link building matter too, but they cannot rescue a catalog that the crawler cannot understand. The ideas are platform neutral. Every platform exposes them somewhere, whether as settings, theme templates or code.

One product, one canonical URL

The first rule is that every distinct piece of content should have one preferred address. A shop easily breaks this rule:

  • /products/trail-shoe
  • /products/trail-shoe?color=blue
  • /men/shoes/trail-shoe (reached through a category)
  • /products/trail-shoe?utm_source=newsletter

To a crawler these are four pages with nearly identical content. Search engines usually pick one and ignore the rest, but not always the one you would choose. You tell them your choice with a canonical link in the page head:

HTML
<link rel="canonical" href="https://shop.example/products/trail-shoe">

Good URL design makes this easier. Keep URLs short, lowercase, and made of readable words (/products/trail-shoe, not /p?id=48213). Put the product at one path regardless of the category the shopper came from, and use categories only for listing pages. Tracking parameters such as utm_source never change the content, so the canonical must leave them out.

Variants need a decision. If a blue and a red shoe are the same product with different options (see Variants and Options), a single canonical page with a variant picker usually ranks best, because all the reviews and links gather in one place. Give variants their own indexable URLs only when people really search for them separately, for example distinct phone models with different specs. Then each variant page needs unique content and a self-referencing canonical.

flowchart TD
    A["/products/trail-shoe?color=blue"] -->|"rel=canonical"| C["/products/trail-shoe"]
    B["/men/shoes/trail-shoe"] -->|"301 redirect"| C
    D["/products/trail-shoe?utm_source=mail"] -->|"rel=canonical"| C

Duplicates either redirect (301) or declare the canonical page.

Use a 301 redirect when the old URL should disappear (a renamed product), and a canonical when the duplicate must keep working for shoppers (a filtered or tracked URL).

Faceted navigation: the crawl trap

Facets let shoppers filter by size, color, brand and price (see Product Search, Filters and Facets). Each combination can become its own URL, and the combinations multiply. Ten brands, twelve colors, eight sizes and five price bands give thousands of pages from one category, nearly all of them thin duplicates. Crawlers waste their budget there, and your real products get visited less often.

A practical policy has three buckets:

Kind of filter page Example Approach
Valuable landing page "Black running shoes" (people search for it) Indexable, clean URL, own title and heading
Useful only to shoppers size 42 + price under 80 + sort by newest noindex, or canonical to the parent category
Infinite or pointless sort orders, session IDs, view modes Block from crawling or avoid links to them

Note the difference between noindex and a robots.txt block. A crawler can only obey noindex if it is allowed to fetch the page. If you block a URL in robots.txt, search engines never see its tags, and the URL can still appear in results if other sites link to it. Use robots.txt to save crawl effort on junk, and noindex to keep fetchable pages out of results. Do not combine both for the same URL.

Make filter links crawlable only where you want them crawled. Filters built as buttons that run JavaScript and update the list do not create new URLs at all, which is the simplest way to avoid the trap for low-value combinations.

Pagination

Category pages with 500 products need pages. Give each page a normal link (?page=2) so that crawlers can reach every product through plain HTML links. Each page should canonicalize to itself, not to page 1, otherwise products on page 5 look like they do not exist. A "load more" button that only calls an API leaves later products unreachable unless real links also exist. Search engines no longer use rel="next" and rel="prev" as indexing signals, although they are harmless.

Structured data for products

Structured data is machine-readable text that says "this page is a product, it costs this much, and it is in stock". Search engines can show prices, availability and ratings directly in results. The common format is JSON-LD, a script block that uses the schema.org vocabulary:

HTML
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Trail Shoe",
  "sku": "TS-100",
  "offers": {
    "@type": "Offer",
    "price": "89.90",
    "priceCurrency": "EUR",
    "availability": "https://schema.org/InStock",
    "url": "https://shop.example/products/trail-shoe"
  }
}
</script>

Rules worth remembering:

  • The data must match what the shopper sees on the page. Marking up a price that the page does not show can lead to a manual penalty.
  • price is a plain number string with a dot as the decimal separator, and priceCurrency is an ISO 4217 code. This is why storing money properly matters (Representing Money Correctly): you convert minor units to a decimal string at the edge.
  • With several variants, you can use an AggregateOffer (low and high price) or one Offer per variant, each with its own SKU.
  • Only mark up reviews that real customers wrote on your site. Never invent ratings.
  • Escape the output. If a product name contains </script>, an unescaped JSON string can break out of the script tag, so replace the less-than character with its Unicode escape (backslash, u, 0, 0, 3, c) when you serialize.

Build the JSON from the same product data that renders the page, in one place of your code. Copy-pasted templates drift out of sync with the visible price.

JS Build Product JSON-LD from catalog data

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Change a stock number to 0 and watch the availability URL flip. Notice that the hostile product name stays harmless inside the output.

Sitemaps

An XML sitemap lists the URLs you want indexed, with a last-modified date. It does not guarantee indexing, but it helps crawlers find new products fast. Rules:

  • One sitemap file holds at most 50,000 URLs or 50 MB uncompressed. Larger shops use a sitemap index that points at several files.
  • List only canonical, indexable URLs that return 200. No redirects, no noindex pages, no filter combinations.
  • Set lastmod to the real time the content changed, not the time the sitemap was generated. If every URL always says "now", crawlers learn to ignore the field.
  • Split by type (products, categories, content) so that you can see in the search console which group has indexing problems.

Out-of-stock and discontinued products

What a product page does when stock hits zero decides whether you keep your ranking:

Situation Best response
Temporarily out of stock Keep the page at 200, show "out of stock", mark OutOfStock, offer a back-in-stock alert
Seasonal item that returns Same as above; do not delete or redirect
Permanently discontinued, with a close replacement 301 redirect to the replacement or its category
Permanently gone, no replacement Return 410 Gone (or 404), or redirect to the category

Do not redirect every sold-out product to the home page. Search engines treat many irrelevant redirects as soft 404s, and shoppers feel misled. Pre-orders and backorders (see Inventory Tracking) should say so in the markup too.

Core Web Vitals and speed

Page experience is a ranking signal, and slow pages also lose orders. Three metrics matter:

  • LCP (Largest Contentful Paint): how fast the main content, usually the product image, appears. Aim for under 2.5 seconds.
  • INP (Interaction to Next Paint): how quickly the page reacts to taps and clicks. Aim for under 200 ms.
  • CLS (Cumulative Layout Shift): how much the layout jumps while loading. Aim for under 0.1.

The usual fixes for shops: serve responsive, compressed images and do not lazy-load the main product image; give every image width and height so the layout does not jump; cache product pages at the edge (Product Pages, Media and Content covers the image side); load third-party scripts such as chat widgets and review tools late, because they are the biggest cause of poor INP.

Finally, serve a real HTML product page. If the price and description only appear after a JavaScript framework fetches them, crawlers may index an empty shell, and shoppers on slow phones wait longer.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A product is reachable at /products/shoe, /products/shoe?color=red and /products/shoe?utm_source=mail. What should the last two URLs do?

    They must keep working for shoppers, so a canonical link pointing to the preferred URL consolidates the signals without breaking links or campaigns.
  2. 2. Why should you not both block a URL in robots.txt and rely on noindex in that page?

    noindex is read from the page itself. If robots.txt stops the fetch, the tag is never seen, and the URL may still show up if other sites link to it.
  3. 3. Which Product JSON-LD price value is correct for 89 euros and 90 cents?

    Price is a number string with a dot, and the currency is a separate ISO 4217 code. Minor units like 8990 must be converted before output.
  4. 4. A popular jacket is out of stock for three weeks but will return. What is the best handling?

    Keeping the page at 200 preserves rankings and links. The markup and message tell shoppers and crawlers the truth.

Summary

  • Give each product one canonical URL; use 301 redirects for URLs that should vanish and canonicals for duplicates that must keep working.
  • Treat faceted navigation as a crawl trap: index only filter pages people search for, and keep the rest out of the index.
  • Use noindex on fetchable pages and robots.txt only to save crawl effort, never both on the same URL.
  • Generate Product and Offer JSON-LD from the same data that renders the page, with plain decimal prices, ISO currency codes and escaped output.
  • Keep sitemaps limited to canonical 200 URLs with honest lastmod values.
  • Keep temporarily out-of-stock pages live; redirect or retire only products that are really gone.
  • Watch LCP, INP and CLS, and render real HTML on the server.

Next, learn how to measure what shoppers do once they arrive: Analytics, Funnels and Metrics.