Canonical Tag Generator

A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call

Free canonical tag generator. Enter the page address you want in Google to get the rel=canonical tag and HTTP header, with common mistakes caught.

Canonical tag (put it in the page's <head>)
Or, for PDFs and other files: HTTP header

Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.

How to use the canonical tag generator

Enter the address of the page as you want it to appear in Google: the clean, preferred version, usually starting with https:// and without tracking parameters. The generator gives you two things:

  • The canonical tag for the page's HTML, <link rel="canonical" href="…">, to go inside the <head>.
  • The HTTP header version, Link: <…>; rel="canonical", for files that have no HTML head, such as PDFs.

As you type, it checks the address for the mistakes that most often stop it from working: a relative path instead of a full address, a # fragment, tracking parameters like utm_source, http instead of https, an uppercase domain, or an address ending in index.html. Everything runs in your browser; nothing is sent anywhere.

What a canonical tag is

Many websites show the same content at more than one address. A product might be reachable at:

  • https://shop.example/rye-loaf/
  • https://shop.example/rye-loaf/?utm_source=instagram
  • https://shop.example/bread/rye-loaf/
  • http://shop.example/rye-loaf/

To a person these are one page; to a search engine they're four addresses with the same content. Google picks one of them as the canonical version to show in search results and treats the others as duplicates. A canonical is how you tell Google which one you prefer.

The tag sits in the page's <head>:

<link rel="canonical" href="https://shop.example/rye-loaf/">

Every duplicate version carries the same tag, pointing to the same preferred address. It's also good practice for the preferred page to carry a canonical tag pointing to itself, called a self-referencing canonical, so that any copy with extra parameters automatically points back to the clean version.

Why canonical tags matter for SEO

  • Ranking signals are combined. Links pointing to different versions of a page are consolidated onto the canonical, instead of being split between duplicates.
  • The right address shows in search. You decide whether people see the clean product address or a version with a tracking code.
  • Crawling is more efficient. Google spends less time on duplicate addresses and more on your real pages, which matters on large sites.
  • Syndicated content stays credited. If another site republishes your article, a canonical on their copy pointing to your original helps Google treat yours as the source.

One important point: a canonical tag is a strong hint, not a command. Google considers it alongside other signals, such as redirects, internal links and the addresses in your sitemap. If those signals disagree, Google may choose a different canonical from the one you declared. The best results come when every signal points to the same address.

Where to put the canonical tag

  • In the <head>, not the <body>. Google ignores canonicals in the body.
  • Once per page. If a page has two canonicals pointing to different addresses, Google may ignore both. This often happens when a theme adds one and an SEO plugin adds another; check your page source.
  • With a full address. Relative addresses (/rye-loaf/) are allowed but easy to get wrong, for example on a staging site or when the page is served over both http and https. Full addresses are Google's recommendation.

For files without HTML, such as PDFs, send the canonical as an HTTP header instead. On Apache, for example:

<Files "price-list.pdf">
  Header add Link "<https://shop.example/price-list/>; rel=\"canonical\""
</Files>

That's useful when the same document exists as both a web page and a PDF and you want the page to rank.

Common canonical tag mistakes

Pointing every page to the home page

Some sites, or badly configured plugins, set every page's canonical to the home page. That tells Google that every page is a duplicate of the home page, and the other pages can drop out of search. Each page should point to itself, unless it really is a duplicate of another page.

Canonicalizing paginated pages to page 1

On a blog archive or a category with several pages, page 2 shouldn't have a canonical tag pointing to page 1: the pages have different content. Give each page in the series its own self-referencing canonical.

Contradicting signals

If a page's canonical points to address A, but your sitemap lists address B and your internal links all go to address C, Google gets mixed messages. Make the canonical, the sitemap and your links agree. The XML sitemap generator helps you list only canonical addresses.

Canonical and noindex together

Don't combine noindex with a canonical to another page. They send opposite messages: "don't index this" and "this is the same as that page, which should be indexed". Pick the one that matches what you want.

Using a canonical when a redirect is better

If an old address should never be visited again, for example after a page moved, a 301 redirect is stronger and clearer than a canonical. Canonicals are for duplicates that need to keep working, such as tracking links and filtered views. The redirect generator writes the redirect rules.

Blocking the duplicate in robots.txt

If a duplicate page is blocked in robots.txt, Google can't crawl it, so it never sees the canonical on it. Leave duplicates crawlable so the tag can do its job.

Canonical tags and other SEO tags

  • Hreflang. Each language version of a page should have a canonical pointing to itself, not to the English version. Different languages aren't duplicates. The hreflang tag generator builds the language tags.
  • Meta tags. The canonical goes alongside your title and meta description. The meta tag generator includes one in its output too.
  • Open Graph. Social networks use og:url in a similar way, as the address to credit when your page is shared. Keep it the same as the canonical.

How to check which canonical Google chose

In Google Search Console, use the URL Inspection tool on any page. It shows two values:

  • User-declared canonical: the address in your canonical tag.
  • Google-selected canonical: the address Google actually chose.

If they differ, look for the conflicting signals above: internal links, the sitemap, redirects, or content that differs more than you think between versions.

Canonical tags on common platforms

  • WordPress: SEO plugins such as Yoast SEO or Rank Math add a self-referencing canonical to every page automatically, and let you set a different one per page in the post editor.
  • Shopify: themes include one by default through {{ canonical_url }} in theme.liquid.
  • Wix and Squarespace: canonicals are added automatically; Wix also lets you edit them in a page's SEO settings.
  • Hand-built sites: add the tag from this generator to each page template's <head>.

Before adding one by hand, view the page source (right-click, View page source) and search for canonical to make sure there isn't one already.

A worked example

A bakery shares its menu page on Instagram with tracking links like https://crumbandco.example/menu/?utm_source=instagram&utm_medium=social, built with the UTM builder. Google finds these addresses through shared links and starts showing one of them in search, tracking code and all.

The owner enters https://crumbandco.example/menu/ into the canonical tag generator. It reports no problems and gives the tag <link rel="canonical" href="https://crumbandco.example/menu/">, which goes into the menu page template. Because the tag is part of the page, every version of the menu, with or without tracking parameters, now carries it and points to the clean address. A few weeks later, URL Inspection shows the clean address as both the user-declared and the Google-selected canonical.

Out of curiosity, the owner also pasted a tracking link into the canonical tag generator. It flagged the utm_ parameters with a warning, a reminder that the canonical should always be the clean address.

Search ads for the searches that matter now

Good markup helps your pages rank over time. Google Ads puts the same pages in front of buyers today. DeepRit manages Google Ads for small and mid-size businesses, and only Google Ads. We check your account before we ever get on a call, then fix the structure, the keywords, the tracking and the ads, with month-to-month terms and no long contract. Book a free audit call.

Frequently asked questions

What does a canonical tag do?

It tells search engines which address is the preferred version of a page when the same content is available at several addresses, so ranking signals are combined and the right address appears in results.

Should every page have a canonical tag?

It's good practice. A self-referencing canonical on each page means any copy with extra parameters automatically points back to the clean address.

Does Google always follow the canonical tag?

No. It's a strong hint, not a rule. Google also looks at redirects, internal links and your sitemap, and may choose a different address if those disagree.

Should the canonical tag use a full address?

Yes. Relative addresses work, but full addresses starting with https:// avoid mistakes and are what Google recommends.

Can I use a canonical tag across different domains?

Yes. A cross-domain canonical is useful when your content is republished on another site, so the original gets the credit.

Is the canonical tag generator free?

Yes. It's free with no sign-up, and it runs entirely in your browser, so nothing you enter is sent or stored anywhere.

Free PPC audit

See where your ad budget leaks.

We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.

Book a free audit call 30-minute call · Free · The audit is yours to keep