SEO & Metadata

What is a canonical URL?

The "official" URL for a piece of content when multiple URLs could return the same content, declared via `<link rel="canonical" href="…">`.

Search engines have to handle the case where the same article is reachable at example.com/post, example.com/post?utm_source=twitter, example.com/post/, and m.example.com/post. The canonical link tells them: "treat all of these as variants of this one URL." Google then consolidates ranking signals onto the canonical version instead of splitting them across duplicates.

Setting canonical correctly is one of the highest-ROI SEO fixes for content-heavy sites. Common pitfalls: leaving the canonical pointing at staging, accidentally setting every page to canonical to the homepage, or self-referencing canonicals on UTM-parameterized URLs (correct) versus on truly different pages (wrong).

Canonical is a hint, not a directive. Google can override it if other signals contradict (e.g., you canonical to a 404). For absolute control over what gets indexed, use noindex instead.

In the wild

  • <link rel="canonical" href="https://brand.dev/blog/post-title"> on every variant of that post
  • Removing query strings from canonical URLs to consolidate UTM-tagged variants

How Brand.dev uses canonical url

Endpoints in the Brand.dev API where this concept comes up directly.

FAQ

Canonical vs 301 redirect?

A 301 sends the user (and the crawler) to a different URL. Canonical leaves both URLs accessible but tells the crawler to credit one. Use 301 when you want one URL to disappear; canonical when both must keep working.

Should every page canonical to itself?

Yes, self-referential canonicals are a clean default that protects against accidental query-string duplication.

What if Google ignores my canonical?

It does that when other signals contradict (the canonical target is broken, links overwhelmingly point to the variant, etc.). Use Google Search Console's "Indexed, though canonical was different" report to debug.

Related terms

Ship an agent that actually knows things.

Free tier, 10-minute integration, and the same API powering agents at Mintlify, daily.dev, and Propane. No credit card to start.