Skip to content
Passieon

Canonical URLs: how Google picks one version of a page

Many sites serve the same page at more than one address. The page may load with and without a trailing slash, over HTTP and HTTPS, or with tracking parameters on the end. Google groups those versions together and shows one of them in results. This guide explains how that choice works and what you can do to influence it.

Short answer: Canonicalization is how Google chooses one representative URL from a set of duplicate or near-duplicate pages. Google picks the version it judges most complete and useful. You can steer that choice with redirects, rel="canonical" annotations, sitemap entries and consistent internal links. Those signals are requests that Google can weigh, so check which address Google chose.

Written by Hamza Rivera. Last reviewed

Hamza works in SEO and GEO/AEO. He writes the Passieon guides and checklists and does the SEO work for the businesses Passieon serves.

Know why duplicates happen

Google's documentation lists several common causes. Region variants are separate US and UK addresses with the same content in the same language. Device variants are a mobile and a desktop version of one page. Protocol variants are the HTTP and HTTPS versions of a site. Site functions create them too, such as the sorted and filtered views of a category page. Accidental variants happen when a demo copy of the site is left open to crawlers. Some duplicate content is normal, and Google does not treat it as a violation of its spam policies. The real cost is confusion, for visitors who wonder which page is right, and for you when you try to read your reports.

See how Google chooses the canonical

When Google indexes a page, it works out the main content of that page. If several pages have the same or very similar main content, Google groups them into a cluster. It then picks the page it judges most complete and useful for search users, and marks that page as canonical. Google crawls the canonical page most regularly and crawls the duplicates less often, which eases the load on your server. Google names a handful of factors that feed the choice: HTTP or HTTPS, redirects, presence in a sitemap, and rel="canonical" annotations. Google may still pick a different page than the one you prefer, for various reasons, so treat your signals as a hint.

Know which methods carry the most weight

Google ranks the methods by how strongly they influence the choice. A redirect is a strong signal that the target should become canonical. A rel="canonical" annotation is also a strong signal. A sitemap entry is a weaker signal that helps a URL become canonical. Methods can stack, so when you use two or more on the same pair of URLs, your preferred address is more likely to appear in results. None of the methods is required. If you set no canonical at all, Google works out the best version on its own, and many small sites do well that way.

Use a redirect when the duplicate should go

If a duplicate page no longer needs to exist, send it to the page you want with a permanent redirect. Google says every permanent redirect type has the same effect on Search, although the time it takes Google to notice the change can vary by method. A server-side redirect is the quickest. Pick one address for the home page, such as https://www.bluepeak.com, and send the other addresses to it. Use a redirect when you are retiring the duplicate, because visitors who reach the old address will also land on the new one.

Add a rel="canonical" link in the head

For pages that must stay live, place a link element in the head of each duplicate. The element uses rel="canonical" and an href that points to the chosen address. Google accepts the element only inside the head section, so check that the head of the page is valid HTML. Use the full address with the protocol and host. A relative path can cause trouble if a test copy of the site is ever crawled. For a PDF or another non-HTML file, Google supports a rel="canonical" HTTP header instead. Choose either the element or the header for each page, because using both can lead to conflicting addresses.

Add a self-referential canonical to the canonical page

Google recommends adding the same canonical element to the canonical page itself. This is called a self-referential canonical, and it states your preference on the page you want shown. If the canonical page has a separate mobile address, add a rel="alternate" element that points to the mobile version, so Google can connect the two. In our view, a self-referential canonical is the cheapest protection a site can add. Check it first on any page that carries query strings or tracking tags, because those pages create new addresses.

List the canonical URLs in your sitemap

Google describes a sitemap as a simple way to set canonicals on a large site. Every URL in a sitemap is suggested as a canonical, and Google decides for itself which pages are duplicates, based on how similar their content is. Because Google still has to find the duplicates for any canonical you declare in a sitemap, the sitemap entry carries less weight than a canonical element. Keep the sitemap and the canonical element pointing to the same address, so the two signals agree. The XML sitemaps guide on this site covers the format itself.

Point your internal links at the canonical

Link to the canonical URL everywhere on your own site, including the navigation, the footer, breadcrumbs and the links inside articles. Google's documentation says consistent linking helps Google understand which version you consider the main one. Run a crawl of your site every month and fix the links that point to duplicates. The URL structure guide on this site covers how to choose one form for each address.

Choose one form for each address

Before you set any canonical, decide on the form every address should take. Choose the protocol, whether the host includes www, whether pages end with a trailing slash, and whether paths are lower case. Then redirect the other forms to that one. Google's own example lists home, home.bluepeak.com and www.bluepeak.com as three ways to reach one site, and it suggests choosing one of them as the canonical address. This decision comes first because a canonical tag alone cannot fix a site that serves several addresses for every page.

Prefer HTTPS to HTTP

Google prefers HTTPS pages over equivalent HTTP pages as canonical, unless something conflicts with that preference. Conflicts include an invalid SSL certificate, insecure dependencies other than images, a redirect from HTTPS to HTTP, or a canonical link on an HTTPS page that points to the HTTP version. To keep the preference, redirect HTTP to HTTPS, add a canonical link from the HTTP page to the HTTPS page, and consider HSTS. Make sure the certificate covers the full host name, either directly or through a wildcard. Avoid bad certificates and HTTPS-to-HTTP redirects, because they push Google toward HTTP strongly, and HSTS does not undo that. Do not list HTTP addresses in your sitemap or hreflang annotations.

Skip the methods that do not work for this

Some common shortcuts do not solve canonicalization. Do not use robots.txt for this, because Google may still index a URL that robots.txt disallows, although it cannot read the content. The robots.txt guide on this site explains what that file does. Do not use the URL removal tool either, because it hides every version of a URL from Search. Google also does not support URL fragments as canonicals. Avoid noindex as a way to choose between pages on one site, because it removes the page from Search completely. Finally, do not declare different canonicals for the same page through different methods, such as one address in the sitemap and another in the canonical element.

Handle language and region versions

Translated pages count as duplicates only when their main content is in the same language. If only the header, footer and menus are translated, the pages are still duplicates. For regional variants in the same language, such as a US page and a UK page, use canonicals together with hreflang annotations, so Google knows which regional address to show. When you use hreflang, make sure each page names a canonical in the same language, or the closest substitute when no same-language canonical exists. Google's guide to multi-regional sites explains the details.

Check the choice Google made

Check which address Google shows in results for the page you care about, and compare it with the address you intended. If Google chose a different address than you intended, look first for a conflicting signal, such as a redirect, a sitemap entry, an internal link or an HTTP address that still responds. Make the fix, then wait for the next crawl before you judge the result. The Search Console guide on this site explains where else to look for crawl and indexing data.

A worked example with a made-up bakery

Imagine a bakery that sells the same sourdough loaf at three web addresses: one with the www host, one without it, and one with a tracking parameter from an email campaign. Their internal links use all three, and the parameter version appears in a few reports. The team chooses the www HTTPS address as the one form. They redirect the bare host and the HTTP address to it, add a self-referential canonical to each product page, and change the email links to the plain address. They also update the sitemap so it lists only the chosen form. The next crawl shows which address Google selected, and the team compares it with their list. The example shows the method only, so use your own reports to decide what to fix.

Know when the default is fine

Many small sites do not need to do anything. If each page has one address and the site uses no tracking parameters, Google can often work out the best version on its own, and Google's documentation says a site will likely do just fine without a canonical preference. In our view, act when a report shows duplicate pages, when Google picks an address you did not expect, or when filters, sorting or parameters create new addresses for the same content. Start with the one-form decision and the self-referential canonical, then add more signals only if the reports still show a problem.

Write down the canonical rules for your site

Record the chosen form of each address, the canonical method used for each template, and the person who maintains it. Keep the note with your release log, so a new template does not quietly add a second address for every page. In our view, a short written rule prevents most canonical problems, because most of them begin with a new template that nobody checked. The indexing guide on this site explains the reports to watch once the rules are in place.

Related help

Sources for technical rules

Google's documentation is the authority for its own search systems. This guide explains the work in our words.

Book a call with us

A 30-minute call in your working hours. Tell us what you sell and where, and we will tell you what we would do first and what it involves. Prefer email? Send your website through the form and the Passieon Team will reply by email.

Book a call

Message us

Message us

Ask anything about your site or where your inquiries are going. It goes straight to a person, not a bot. Leave an email and you get a reply.