Skip to content
hostcomplex

Canonical URL (rel=canonical)

Maarten Soetens 2 min read

What Is a Canonical URL and How Is It Declared?

A canonical URL is the address a search engine should treat as the main version of a page when several URLs show the same or very similar content. Website owners declare it with a canonical link element, written as rel=canonical, placed in the head section of the HTML. The element points to the preferred address.

A single line in the page head looks like this: <link rel="canonical" href="/shoes/">. The canonical element is a hint, not a command. Search engines weigh it together with other signals when they choose the version to index.

Why One Page Can Be Reachable at Several URLs

Many sites create extra addresses without meaning to. Sorting and filtering options add parameters, such as ?sort=price. Tracking tags add codes for campaigns. Some pages also answer on both http and https, or with and without a trailing slash. Host variants such as www and non-www do the same. To a crawler, each of these is a separate URL, even when the content is identical. The wider issue is covered in our article on duplicate content.

Imagine an online shop where one blue shirt is reachable at /shirts/blue-shirt, /shirts/blue-shirt?color=blue and /sale/blue-shirt. A canonical tag on all three pages that points to /shirts/blue-shirt tells search engines which version the shop wants indexed. The other two addresses keep working for visitors.

Self-Referencing and Cross-Domain Canonicals

A self-referencing canonical points a page to its own address. It is a common default because it removes ambiguity when parameters or copies appear later. A cross-domain canonical points to a page on another website. It is used when an article is republished on a partner site and the original should count. The content on both sites should be substantially the same for the tag to make sense.

Search engines may choose a different canonical than the one declared. Redirects, internal links, sitemap entries and HTTPS status can all contradict the tag. When signals disagree, the engine picks the version it considers better, so keeping these signals consistent is the best protection.

Frequently asked questions

Is a canonical tag the same as a redirect?

No. A canonical tag is a suggestion, and visitors still see the page at its own address. A redirect sends both visitors and search engines to another URL. Use a redirect when the old address should no longer be used. Use a canonical tag when several addresses must stay live, such as filtered product lists.

Can a canonical tag hurt my rankings?

It can, when it is wrong. Pointing a page to an unrelated page, a missing page or a page that redirects can confuse the engine and remove the intended page from results. Check that every canonical points to a live, indexable version of the same content.

  • Two-Factor Authentication

    Two factor authentication hosting adds a second check to control panel, domain and CMS logins. Learn which methods are strongest and why 2FA helps.

  • What Is an A Record?

    What is an A record? Learn how this DNS record maps a hostname to an IPv4 address, why domains use several A records and the root and www pattern.

  • Billing and Automation Platforms

    What is WHMCS? Learn how this commercial billing and automation platform helps hosts sell plans, collect payments and create accounts automatically.