← Back to Index

Canonical Tag

FigureHow canonical tags consolidate ranking signals from duplicate URLs to a single master URL.

What is a Canonical Tag?

The canonical tag is your primary defense against duplicate content issues. In modern CMS environments (like WordPress, Shopify, or Next.js), a single page is often accessible via multiple URLs (e.g., with query parameters, capitalization differences, or tracking IDs). The canonical tag tells Google: "Ignore those other variations; this is the URL I want you to rank."

Why it Matters for SEO

1. Consolidates Link Equity (PageRank)

If five different URLs point to the same content, backlinks might be split among them. A canonical tag acts like a magnet, pulling all that "link juice" to a single, authoritative URL, boosting its ranking potential.

2. Prevents "Crawl Budget" Waste

Googlebot has limited resources. If it spends time crawling example.com/product?color=red and example.com/product?color=blue separately, it might miss your important new blog post. Canonical tags encourage Google to focus on unique content.

3. Solves Syndication Issues

If you republish your content on other sites (like Medium or LinkedIn), a canonical tag ensures your original site gets the credit (and the ranking), rather than the third-party platform.

Code Implementation

Place this tag in the <head> section of your HTML:

html
<link rel="canonical" href="https://example.com/sample-page/" />

Critical Rules:

  • Absolute URLs Only: Never use /sample-page/. Always use https://example.com/sample-page/.
  • Self-Referencing: Yes, page A should point to page A. This prevents scrapers or URL parameters from hijacking the page's authority.
  • HTTPS: Always point to the secure version of your URL.

Common Pitfalls & How to Fix

The "Near-Duplicate" Trap

The Mistake: Using canonical tags on pages that are distinctly different (e.g., pointing Page B to Page A just because Page A has higher authority).

The Fix: Only canonicalize pages with identical or nearly identical content. If the content is different, use a 301 redirect or let them stand alone.

The "Chain" Error

The Mistake: Page A has a canonical pointing to Page B, but Page B has a canonical pointing to Page C.

The Fix: Always point directly to the final destination. Page A -> Page C.

Ignoring URL Parameters

The Mistake: E-commerce sites often generate URLs like ?sort=price_asc. If these don't self-canonicalize to the main category page, you generate thousands of low-value pages.

The Fix: Ensure filter/sort pages canonicalize back to the root category URL (e.g., example.com/shoes).

How to Audit with Mygom

Our scanner checks for three specific failure states:

  1. Missing Tag: The page is vulnerable to duplication.
  2. Relative URL: The tag exists but might be interpreted incorrectly by bots.
  3. Mismatch: The page URL and the canonical URL do not match (which is valid, but needs to be intentional).