About the Canonical Tag Generator
The same content often appears at several addresses: with tracking parameters, with and without a trailing slash, as a print version or under two categories in an online shop. A canonical tag tells search engines which address is the main one, so ranking signals are not split. This canonical tag generator builds correct rel=canonical tags for a single page or a whole list of URLs, as absolute addresses on your preferred protocol and hostname, and explains the mistakes that cause trouble, such as pointing every page to the home page. Canonical tags are hints rather than commands, so keep internal links and sitemaps consistent with them. For permanent moves, use the 301 Redirect Generator, and for sitemaps, the XML Sitemap Generator.
Besides writing the link tag, the tool checks it for the mistakes that silently stop canonicals from working. The address must be absolute, so a relative path is flagged. It should lead to a page that answers with status 200 rather than a redirect. Each page should carry exactly one canonical, because two that disagree are ignored altogether, a common result of a theme and an SEO plugin both adding one. Worst of all is a theme or plugin that prints one fixed address, frequently the homepage, on every URL, effectively asking search engines to fold the entire site into one document.
An optional hreflang section produces the alternate-language links for international sites, such as English, Urdu and Arabic versions of the same page, including the x-default entry, along with a reminder that every language version must link back to the others for the annotations to be trusted. Check the tags again after any site migration, because a canonical still pointing at an old domain quietly tells search engines to prefer the old address.
How to use the Canonical Tag Generator
- Enter the preferred addressType the full URL of the version you want search engines to index.
- Read the warningsRelative paths, missing https and tracking parameters are highlighted.
- Add language versions if neededAdd one row for each language or region, plus an x-default entry.
- Copy the tagsPaste the block into the head section of the page.
Canonical Tag Generator features
- Correct rel=canonical link tag
- Warnings for relative addresses and missing protocols
- Tracking parameters left in the address flagged
- Helper for self-referencing canonicals
- Optional hreflang links with x-default
- Explanation of why hreflang links must be reciprocal
- One-click copy of everything for the page head
Common uses
- Merging the signals of several near-identical product URLs created by colour or size filters
- Sending addresses with tracking parameters to the clean version
- Adding a self-referencing canonical to every page
- Linking the language versions of an international site
- Confirming a canonical tag is written correctly
Canonical tags in practice: the same content on two websites, products in several categories, pagination, conflicting signals and checking Google's choice
A canonical tag tells search engines which address is the main version of a page when similar content is available at several addresses. Used well, it consolidates ranking signals onto one URL; used carelessly, it can hide good pages from search. This guide looks at the same content published on two websites, then covers products in several categories, parameters, pagination, conflicting signals, non-HTML files and checking which version Google chose.
A worked example: the same content on two websites
A business runs two websites that both publish the same tool pages and articles. Search engines see duplicate content across domains and pick one version to show, which may not be the one the owner prefers, and ad networks may judge both sites as offering little original value. A cross-domain canonical on each copy, pointing to the original page on the main site, tells search engines which version to rank. Better still is to make each site's content genuinely different, or to keep the copies out of search with noindex or remove them.
Products in several categories
Shops often reach the same product through different paths, such as /men/kurta-blue and /sale/kurta-blue. Choosing one address as canonical, and pointing the others to it, prevents the product's signals being split. Ideally, every internal link uses the canonical address too.
Parameters
Sorting, filtering and tracking parameters create many addresses for the same content. A canonical tag on each variant pointing to the clean address keeps search engines focused on the main page. Self-referencing canonical tags on clean pages also protect against tagged links shared elsewhere.
Pagination
Page two of a category is not a duplicate of page one, because it lists different items. Google advises that each paginated page should have a canonical pointing to itself, not to page one. Pointing every page to the first hides the products on later pages from search.
Conflicting signals
A canonical pointing to a page that redirects, returns an error, is marked noindex or is blocked by robots rules sends mixed signals, and search engines may ignore it. Canonical targets should be live, indexable pages that return a normal status. Sitemaps and internal links should list the same canonical addresses.
PDFs and other files
Files such as PDFs cannot carry an HTML tag, but a server can send a canonical as an HTTP header, written as a Link header with rel="canonical". This is useful when the same document is available both as a web page and as a PDF and the page should be the version shown in search.
Checking Google's choice
The URL Inspection tool in Search Console shows both the canonical declared by the page and the canonical Google selected. If they differ, look for duplicate content, inconsistent internal links or redirects that point elsewhere, and align the signals so the preferred address is unambiguous.
Canonicals are hints
Search engines treat canonical tags as strong hints rather than commands. When other signals, such as internal links and sitemaps, consistently point to the same address, the hint is almost always followed. Inconsistent signals are the usual reason a canonical is ignored.
Common mistakes
- Pointing every paginated page to page one.
- Canonicalising to addresses that redirect or are noindexed.
- Linking internally to non-canonical versions.
- Leaving duplicate content on two domains without a decision.
Related tools
To clean up lists of duplicate addresses, use Duplicate URL Remover. To redirect alternative addresses, try 301 Redirect Generator, and for language versions, Hreflang Tag Generator.
Syndicated articles
When your article is republished on another site, such as a partner publication or a blogging platform, the copy can outrank the original. Google now recommends that syndication partners keep their copies out of search with noindex, since a cross-site canonical may not be honoured. Agree this with partners before allowing republication.
Template mistakes
A common and costly error is a template that outputs the home page address as the canonical on every page, telling search engines that the whole site is a duplicate of the home page. After any theme or template change, check the canonical on several different page types in the page source.
Protocol, host and slashes
The canonical address should match the preferred form of the site exactly: https, with or without www as chosen, and with consistent trailing slashes. A canonical pointing to the http or www version while the site redirects elsewhere creates the conflicting signals described above.
Older mobile and AMP pages
Sites that once had separate mobile pages or AMP versions should point those versions' canonical tags to the main pages, or redirect them entirely. Modern responsive sites need only one version of each page, which keeps canonical handling simple.
Review after migrations
After moving to a new domain, theme or content system, check canonical tags on a sample of every page type. Migrations often carry over old domains or patterns in templates, and a canonical pointing to the old site can undo the benefit of carefully planned redirects.
Privacy
Tags are generated in your browser. Nothing is sent anywhere or stored.
Frequently asked questions
Should every page include a canonical tag?
A canonical that points to the page itself is a sensible default for every page. It is free insurance against tracking codes, filters and session parameters producing copies you never intended.
Can I write the canonical as a relative path?
No, write it in full. Relative canonicals are interpreted inconsistently and are a common reason a tag looks present but has no effect. Always include the protocol and the full domain name.
Is a canonical a command or a suggestion?
A suggestion. Search engines usually respect it but may choose another page when other signals disagree, for instance when the chosen address shows unrelated text.
Which canonical error causes the most damage?
A shared header that hard-codes one canonical for the whole site. One misconfigured setting can do it, and the result is that only a single page gets indexed.
Can a canonical point to a different domain?
Yes. Syndicated articles use exactly this to name the outlet that first published them. Both sides should agree, because the canonical hands the indexing signal to the other website.
Does hreflang replace the canonical tag?
No, the two work together. Each language version keeps a canonical that points to itself, while hreflang tells search engines the versions are alternatives. The annotations must appear reciprocally on every version or they are ignored.