Skip to main content
SEO / Web
Published 6 min read

Canonical URL vs og:url: What's the Difference?

Two tags that both name a page's address: who reads each, why they should usually match, and when they may differ.

Two tags in a page's head often name the same address: <link rel="canonical"> and <meta property="og:url">. They look redundant, yet they are read by different systems. Understanding who reads which tells you when a difference is harmless and when it hides a mistake.

What each one is for

Canonical linkog:url
Markup<link rel="canonical" href="..."><meta property="og:url" content="...">
Mainly read bySearch enginesSocial platforms and link-preview crawlers
PurposeSays which URL is the preferred version when several URLs show the same contentSays which URL identifies the page for sharing, so variants are treated as one
Also available asAn HTTP Link headerOnly the meta tag

Search engines treat the canonical as a strong hint, not a command, so they can choose differently. Social platforms treat og:url as the page's identity and may group shares or likes under it, though behavior varies.

Why they should usually match

If the canonical says one address and og:url says another, you are telling two audiences two different things about the same page. Search engines may consolidate signals on one URL while social platforms attribute shares to another. Using one preferred URL in both is simpler and avoids splitting. This is why the analyzer compares the analyzed URL, the canonical and og:url, and reports when all three differ.

Differences that are usually fine

  • The analyzed URL has tracking or session parameters that the canonical and og:url correctly leave out.
  • The analyzed URL is a redirect source and the canonical and og:url name the final page.
  • A paginated or filtered view canonicalizes to a base listing.

Differences that are usually mistakes

  • og:url differs from the canonical only by a trailing slash, http versus https, or www versus non-www.
  • Either tag points to a staging or development host copied from a template.
  • The canonical points to a different domain unintentionally.
  • Several canonical tags with different values, which makes search engines likely to ignore them.
  • A relative canonical that resolves wrongly behind a proxy or <base> tag.

Intentional cross-domain use exists

Syndicated or mirrored content can legitimately canonicalize to another site. The analyzer marks cross-host differences as potential issues, not errors, because it cannot know your intent.

Best practice

  1. Choose one preferred URL form: protocol, host, trailing slash and path.
  2. Output it as an absolute URL in both the canonical and og:url.
  3. Leave tracking parameters out of both.
  4. Make sure the preferred URL returns 200 and does not redirect elsewhere (check with the Redirect Chain Analyzer).
  5. Check the result with the Open Graph & Social Preview Analyzer, which fetches the canonical URL too and reports if it redirects or fails.

Frequently asked questions

Should og:url match the canonical URL?
Usually yes. Both name the preferred address of the page, and using the same URL avoids mixed signals for search engines and social platforms. A difference can be intentional, but it should be a decision.
Does og:url replace the canonical link?
No. Search engines use the canonical link element for their purposes. og:url is read by social platforms. They overlap in meaning but are consumed separately.
Can og:url have tracking parameters?
It is better to leave them out. og:url is meant to identify the page itself, so including campaign parameters can split a page's shares across many addresses.
Does a trailing slash matter?
To crawlers /page and /page/ can be different addresses. Pick one form and use it in the canonical, og:url, sitemap and internal links.

The tool that pairs with this guide.

Did this help you untangle your redirects?

If these free developer tools save you time, consider buying me a byte. Your support helps keep DevCraftKit free and growing.

Buy me a byte 💾