A canonical URL is an attribute that tells search engines which version of a page is preferred when duplicates exist. Duplicate content dilutes indexing and link equity. Canonicals address this by consolidating signals on a single URL. This guide covers the syntax, use cases, and common mistakes.
What is a canonical URL?
A canonical URL is the address that a search engine considers the primary version of a page. If the same content is available at multiple URLs, the canonical indicates which one to index and rank.
Syntax
<link rel="canonical" href="https://example.com/page" />It is placed in the page’s <head>. The href is the absolute URL of the preferred version.
How it works
A search crawler sees the canonical and understands: “Signals (links, content) from this page and its duplicates should be attributed to the specified URL.” Duplicates do not disappear from the index immediately, but they stop competing with the canonical version.
When to use a canonical
URL parameters
A page is available with different parameters (sorting, filters, UTM):
example.com/catalog?sort=price
example.com/catalog?sort=name
example.com/catalog?utm_source=emailWithout a canonical, there are many duplicates. With a canonical, they all point to example.com/catalog.
<!-- На странице /catalog?sort=price -->
<link rel="canonical" href="https://example.com/catalog" />Protocol and www
HTTP and HTTPS, with and without www—four versions of the same site:
http://example.com
https://example.com
http://www.example.com
https://www.example.comChoose one version (usually HTTPS without www) and canonicalize the others to it. Use a 301 redirect, plus a canonical on the destination page.
Pagination
Paginated pages with different products or articles have different content. Each such page needs its own canonical. Do not point the canonical on the second and subsequent pages to the first page:
<!-- На /catalog?page=2 -->
<link rel="canonical" href="https://example.com/catalog?page=2" />Google no longer uses rel="prev" and rel="next" to determine the sequence of pages. Link the pages with regular links using href and check that each URL is accessible. These guidelines are provided in Google’s pagination documentation.
Mobile and desktop versions
If there is a separate mobile URL (m.example.com), the canonical on the mobile page should point to the desktop version. With responsive design (one URL), the canonical should point to itself.
Print and AMP
Print versions (?print=1) and AMP pages should canonicalize to the primary version:
<!-- На AMP-странице -->
<link rel="canonical" href="https://example.com/article" />Content syndication
If your content is published on other sites (partners, aggregators), the canonical on your site identifies your version as the original source.
Self-referencing canonical
Every page should have a canonical pointing to itself (a self-referencing canonical):
<!-- На странице https://example.com/article -->
<link rel="canonical" href="https://example.com/article" />Even if there are no duplicates, an explicit canonical establishes the preferred URL (taking parameters, trailing slashes, and other factors into account) and prevents duplicates from appearing through unexpected URL variants.
Canonical vs. redirect
| Method | Behavior |
|---|---|
| 301 redirect | The user and crawler are redirected to another URL. The old URL is not displayed. |
| Canonical | The user stays at the current URL. The crawler attributes the content to the canonical URL. |
Use a redirect when visitors need to be taken to another address, for example, from HTTP to HTTPS. A canonical is suitable for identical or substantially similar versions of content. Paginated pages with different list items should not automatically be treated as duplicates.
Absolute vs. relative URLs
Google recommends absolute URLs:
<!-- Рекомендуется -->
<link rel="canonical" href="https://example.com/page" />
<!-- Не рекомендуется -->
<link rel="canonical" href="/page" />Relative URLs may work, but absolute URLs are more reliable with CDNs, mirrors, and different domains.
Checking canonicals
The canonical checker on reChecker analyzes markup and identifies errors. For a comprehensive check, use the reChecker technical audit.
Common mistakes
Canonical points to the wrong page
Check that the href points to the correct page. A canonical pointing to a nonexistent URL or different content can result in lost indexation.
Canonical chains
Page A canonicalizes to B, and B to C. Google may not follow long chains. A canonical should point directly to the final page.
Canonical and hreflang
On multilingual pages, the canonical should point to the page itself. Do not canonicalize the Russian page to the English page—they are different content versions. Learn more in the hreflang guide.
Canonicals in different CMSs
WordPress
SEO plugins (Yoast, Rank Math) add canonicals automatically. Check the settings: self-referencing is the default. Pagination may require additional configuration.
1С-Битрикс
Configure this in the main module settings or through a template. Check that canonicals are generated for all page types (catalog, product detail page, sections).
Shopify, WooCommerce
Canonical URLs are usually configured automatically. For products with variants (color, size), use a canonical pointing to the main product page.
Custom solutions
Add canonical generation to the head template. Logic: use the current URL, without parameters (or with the required ones), in absolute form.
Canonicals and mobile indexing
With responsive design (one URL for all devices), the canonical should point to itself. With a separate mobile URL (m.example.com), the canonical on the mobile page should point to the desktop version. Google recommends responsive design with a single URL.
Mistakes that break indexing
Canonical points to 404
If a canonical points to a page that does not exist, the search engine may exclude both the current page and the “canonical” page from the index. Always check that the target URL returns 200.
Canonical points to a redirect
A canonical pointing to a URL that 301 to another URL creates a chain. The canonical should point to the final URL, which returns 200.
Different canonicals on one page
Multiple link rel="canonical" tags with different href values create ambiguity. Use one canonical per page.
Validating canonicals
Check the markup after implementation:
- Open the page in a browser
- View the page source and find link rel="canonical"
- Check that the href is correct and points to an existing page
- For duplicates, make sure the canonical points to the preferred version
The canonical checker on reChecker automates the check.
Canonical configuration checklist
| Check | Action |
|---|---|
| Self-referencing on all pages | Add a canonical pointing to each page itself |
| URL parameters | Canonicalize to the version without parameters or to the primary version |
| Pagination with different content | Give each page its own canonical |
| www/non-www, http/https | Use one version and add a redirect |
| Absolute URLs | Use full URLs |
| No chains | Link directly to the final page |
| Canonical does not point to 404/redirect | The target URL returns 200 |
| One canonical per page | Avoid duplicate tags |
Canonicals and social networks
Open Graph and Twitter Card use the page URL for previews. If a canonical is present, make sure og:url and twitter:url match the canonical URL. Otherwise, social networks may cache the wrong URL.
Canonicals for APIs and JSON
If a page serves JSON (API, JSON-LD), put the canonical in the HTML. Canonicals are generally not applicable to JSON API responses because APIs are not indexed as web pages.
Migration and changing a canonical
When changing the preferred URL (for example, from /old-page to /new-page), update the canonical on all pages that pointed to the old URL. Add a 301 redirect from the old URL to the new one. Canonicals on the new pages should point to themselves. Google will switch to the new URL over time.
Related materials
Find and fix duplicate content in the duplicate content guide. Check canonicals with the canonical checker and the technical audit on reChecker.