About the Canonical Tag Generator
A canonical tag tells search engines which URL is the main version of a page when the same content is available at several addresses, for example with tracking parameters, with and without a trailing slash, or on printer-friendly versions.
Enter the preferred URL to get the <link rel="canonical"> tag. The tool also checks whether the URL uses HTTPS and can add English and x-default hreflang tags for single-language sites.
How to use the Canonical Tag Generator
- Enter the full preferred URL, including https://.
- Choose whether to include hreflang tags.
- Copy the tag into the
<head>of every duplicate version, and of the main page itself.
Example
Parameter duplicates
/shoes?utm_source=newsletter and /shoes?sort=price can both point to <link rel="canonical" href="https://example.com/shoes">.
Why duplicate URLs happen
Search engines identify a page by its URL, not by its content. If the same content answers at several addresses, they have to guess which one to list, and signals such as links can be split between the copies. Duplicates are usually accidental: tracking parameters (?utm_source=), sort and filter options, http versus https, www versus the bare domain, a trailing slash or none, and print-friendly versions.
A canonical tag is the pageโs own statement of โthis is the address I want listedโ. Google treats it as a strong hint rather than an order, and it can choose another URL if your signals contradict each other, for example when the canonical points at a page that redirects elsewhere.
What the generator produces
Enter the preferred URL and the tool outputs one line:
<link rel="canonical" href="https://example.com/page">
If you choose โYes (English)โ for hreflang, it adds two more lines, an alternate link with hreflang="en" and one with hreflang="x-default", both pointing at the same URL. That is only right for a site with a single language version. A multilingual site needs one alternate line per language, so build those with the Hreflang Tag Generator instead.
Below the tag you will see the URLโs length, its domain and whether it uses HTTPS. A โNoโ in the HTTPS box is the quickest way to spot a canonical that still points at an old http:// address.
Rules that avoid common mistakes
- Use the full, absolute URL, including
https://and the domain. Relative paths are easy to get wrong. - One canonical per page, placed in the
<head>. Tags in the body are ignored. - Point to a page that works: it should return a normal 200 response, be indexable and not redirect.
- Be consistent with your sitemap, internal links and redirects. They should all name the same preferred URL.
- Do not canonicalise different content together. Page 2 of a list is not a duplicate of page 1.
Examples
Tracking parameters
A newsletter links to https://example.com/shoes?utm_source=newsletter&utm_campaign=may. The pageโs tag says https://example.com/shoes, so every campaign link consolidates into one listing.
Both protocol and host
If your site is reachable at http://www.example.com/about and https://example.com/about, choose the HTTPS, no-www address as preferred and put that single tag on the page. Back it up with a 301 redirect from the other versions.
Syndicated article
You republish a guest article that first appeared on another site. Pointing your canonical at the original tells search engines which version to credit.
Frequently asked questions
Should a page have a self-referencing canonical?
Is canonical a redirect?
Can the canonical point to another domain?
What is the difference between a canonical tag and a 301 redirect?
Where does the canonical tag go?
<head> of the HTML, on the duplicate pages and on the preferred page itself. Search engines ignore it if it appears in the body.