How to Fix Missing Canonical Tags on Shopify & WooCommerce

errorThe Problem

Your page is missing a canonical tag — a small HTML element in the <head> that tells search engines which version of a URL is the 'official' one. Without it, Google may index multiple URLs that show the same content (e.g., /products/shirt and /collections/sale/products/shirt), treating them as separate pages competing against each other.

trending_upWhy It Matters for SEO

Duplicate content dilutes your ranking power. Instead of one strong page, Google sees several weak ones. This is especially common on ecommerce sites where products appear under multiple collections, have variant URLs (?variant=123), or get shared with tracking parameters (?utm_source=...). A canonical tag consolidates all that ranking power into one URL.

buildHow to Fix It

  1. 1

    Go to Shopify Admin → Online Store → Themes → Actions → Edit Code.

  2. 2

    Open layout/theme.liquid.

  3. 3

    Find the <head> section (near the top of the file).

  4. 4

    Check if a canonical tag already exists. Search for 'canonical' — if found, make sure it outputs the correct URL.

  5. 5

    If missing, add the code below inside <head>, before the closing </head> tag.

  6. 6

    Save the file and verify by viewing your page source (Ctrl+U) and searching for 'canonical'.

folderlayout/theme.liquid
{% unless canonical_url == blank %}
  <link rel="canonical" href="{{ canonical_url }}" />
{% endunless %}
menu_bookRead Google's official documentationopen_in_new

Related Fix Guides

Want to check if YOUR store has this issue?

Scan your site for free — get copy-paste fixes in 60 seconds.

searchScan Now — It's Free