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 link | og:url | |
|---|---|---|
| Markup | <link rel="canonical" href="..."> | <meta property="og:url" content="..."> |
| Mainly read by | Search engines | Social platforms and link-preview crawlers |
| Purpose | Says which URL is the preferred version when several URLs show the same content | Says which URL identifies the page for sharing, so variants are treated as one |
| Also available as | An HTTP Link header | Only 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
- Choose one preferred URL form: protocol, host, trailing slash and path.
- Output it as an absolute URL in both the canonical and og:url.
- Leave tracking parameters out of both.
- Make sure the preferred URL returns 200 and does not redirect elsewhere (check with the Redirect Chain Analyzer).
- 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.
Try it yourself
The tool that pairs with this guide.
Open Graph & Social Preview Analyzer
Check Open Graph tags, Twitter/X Cards, social images and link previews for any public webpage.
Redirect Chain Analyzer
Analyze URL redirects, detect redirect chains and loops, and inspect HTTP status behavior.
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.
Related articles
What Are Redirect Chains? Causes, Impact and How to Fix Them
Several hops where one would do: how redirect chains form, what they cost, and how to find and fix them.
Published
301 vs 302 vs 307 vs 308 Redirects: Which Status Code to Use
Two questions decide the code: is the move permanent, and must the request method be preserved?
Published
What Is Open Graph and How Does It Work?
The meta tags behind every link card: what Open Graph is, how platforms use it, and how a preview is built from your page.
Published