Technical SEO

Canonical URL: what it is and how to configure it

Article cover: canonical URL — what it is and how to configure it

What rel canonical is, why search engines need it, and how to add the canonical tag in HTML, HTTP headers, and popular CMS platforms.

What is a canonical URL

A canonical URL (or rel canonical) is an HTML tag that tells a search engine: among all versions of this page, this one is the primary. It solves one of the most common SEO problems — content duplication, where the same material is accessible at multiple addresses.

Without a canonical, the search engine decides on its own which version to treat as primary — and often picks the one you wouldn't want in the index. The tag gives you control: you explicitly declare the preferred URL, and Google and Yandex follow this hint in most cases.

Canonical by the numbers

2009

Year introduced

Google, Yahoo and Bing jointly announced support for rel canonical — the first cross-industry SEO standard

~60%

Sites with duplicates

According to Ahrefs, about 60% of sites have pages with duplicated content that need a canonical

3

Search engines

Google, Yandex and Bing support rel canonical. It is a hint, not a directive: the engine follows it in most but not all cases

≠ 301

Not a redirect

Canonical is a hint for the search engine, not a user redirect. The duplicate page remains accessible at its own URL

Canonical: meaning and core concept

The word "canonical" entered the web from mathematics and logic: canonical form means the simplest, most standard representation of an object. In the URL context, the canonical address is the "official" link that a search engine uses for ranking and indexing, while all other versions are treated as duplicates.

Canonical and 301 redirect are often confused. The key difference: a redirect is a directive, canonical is a hint. A redirect physically moves the user to a new URL. Canonical keeps the user on the original page but tells the search engine which URL to treat as primary for indexing purposes.

Criterionrel="canonical"301 redirect
Signal typeHintDirective
User seesThe duplicate page URLThe destination URL (primary)
Search engine indexesOnly the canonical URLOnly the destination URL
Link equity transferPartial (not 100%)Full (~99%)
Both URLs accessibleYesNo — duplicate returns 301
Use caseDuplicates, filters, paginationPermanent page relocation

How to add the canonical tag

The canonical tag goes in the <head> section of the duplicate page. The syntax hasn't changed since 2009 — it's a single void <link> element. Note that the href attribute must contain a full absolute URL:

HTML
<head>
  <meta charset="UTF-8">
  <title>Laptops — buy at TechShop</title>
  <link rel="canonical" href="https://example.com/catalog/laptops/">
</head>
Common mistake: some write <meta rel="canonical"> or <meta name="canonical"> — that tag does not exist. The only correct form is <link rel="canonical" href="..."> inside <head>. The meta variant is ignored entirely by search engines.

If the page is a PDF, image, or other file without an HTML <head>, canonical can be sent via the Link HTTP header. The nginx configuration below works for both non-HTML resources and regular pages when you control the server directly:

NGINX
# nginx.conf — canonical via HTTP header
# For PDF and other non-HTML resources:
location ~* \.pdf$ {
    add_header Link '<https://example.com/docs/price-list.pdf>; rel="canonical"';
}

# For dynamic URLs with GET parameters:
location /catalog/ {
    add_header Link '<https://example.com/catalog/>; rel="canonical"';
}

Five canonical rules that are broken most often:

  • Absolute URLs only. Always write the full address: https://example.com/page/, not /page/. Relative canonicals are technically supported but behave poorly when a domain or protocol changes.
  • rel canonical https. The canonical must point to the https version of the page. If the site is on HTTPS but the canonical references http://, that creates a duplicate the engine cannot resolve correctly.
  • One canonical per page. Multiple <link rel="canonical"> tags with different href values — the search engine ignores all of them or picks one arbitrarily.
  • Canonical must be reachable. A tag pointing to a 404 or 301 URL is meaningless. The primary page must return 200 OK.
  • Consistent trailing slash. If the primary URL is /catalog/ (with slash), the canonical must also include the slash. Mixing variants creates new duplicates.
Self-canonicalisation is normal and even recommended. A page's canonical can point to itself — this is an explicit signal to the engine that this URL is the primary one. Add self-canonicals to every page on the site, including primary pages.

When to use canonical

Canonical solves six classic content duplication scenarios. Here is each one with real URL examples.

Scenario 1GET parameters and UTM tags

URLs like /catalog/?sort=price and /catalog/?utm_source=email contain the same content as /catalog/. The canonical on all these pages should point to /catalog/. This is the most widespread source of duplicates in e-commerce stores.

Scenario 2Canonical pagination

Pages like /blog/page/2/ and /blog/page/3/ contain unique content, so canonical pagination usually means self-canonicalising each page. Do not point all paginated pages to page 1 — that hides unique content from indexing.

Scenario 3Filters and sorting

A category page with filters can generate hundreds of URLs: /shoes/?color=red&size=42. If a filter page has unique content and search demand, index it. If it's a duplicate of the parent category — canonical pointing to /shoes/.

Scenario 4www, http/https, case

Four homepage variants: http://example.com, https://example.com, http://www.example.com, https://www.example.com. Choose one primary (preferably https://example.com without www) and set canonical + 301 from all others.

Scenario 5Cross-domain canonical

If your article has been reprinted on a partner site (syndication, mirror), ask the partner to add a canonical pointing to your original. Google supports cross-domain canonical — it treats your domain as the source and transfers link equity.

Scenario 6Non canonical and aggregators

If your page appears on multiple aggregators without your involvement, add a self-canonical to the original. Google prioritises URLs with an explicit self-canonical when choosing the primary version among duplicates.

Non canonical is not an error — it's a status. The Google Search Console status "Alternate page with proper canonical tag" means Google accepted your canonical and is not indexing the duplicate. This is the expected result for intentionally de-canonicalised pages.

Canonical in CMS: WordPress, Bitrix and Tilda

Most popular CMS platforms generate canonicals automatically or provide a built-in tool. Manual configuration is only needed for non-standard scenarios or when the CMS doesn't handle them correctly.

WordPress

The Yoast SEO and Rank Math plugins automatically add a self-canonicalising <link rel="canonical"> for every page and post. If you're not using these plugins, add the following to your theme's functions.php:

PHP
<?php
// functions.php — canonical without an SEO plugin
add_action('wp_head', function() {
    if (is_singular()) {
        echo '<link rel="canonical" href="' . esc_url(get_permalink()) . '">' . "\n";
    } elseif (is_home() || is_front_page()) {
        echo '<link rel="canonical" href="' . esc_url(home_url('/')) . '">' . "\n";
    }
}, 1);

Bitrix

In 1C-Bitrix, canonical is set via page properties. The standard approach is to assign the value in a component and output it in the header.php of the main template:

PHP
<?php
// In a component or init.php: set the canonical
$canonicalUrl = 'https://' . SITE_SERVER_NAME . $APPLICATION->GetCurPage(false);
$APPLICATION->SetPageProperty('canonical', $canonicalUrl);

// In the template's header.php: output the tag
$canonical = $APPLICATION->GetPageProperty('canonical');
if ($canonical):
?><link rel="canonical" href="<?= htmlspecialchars($canonical, ENT_QUOTES, 'UTF-8') ?>">
<?php endif; ?>

Tilda

Tilda: for each page, open Page Settings → SEO tab → Canonical URL field. Tilda inserts the tag into <head> automatically. For cross-domain canonical or custom cases, use a Zero Block with an HTML insert in <head>.

Errors and verification via Google Search Console

Google Search Console is the primary tool for monitoring canonical status. In the Indexing → Pages report you will see several statuses related to canonical:

GSC statusWhat it meansWhat to do
Alternate page with proper canonical tagGoogle accepted your canonical. The duplicate is not indexed; link equity flows to the primary pageAll correct — this is the expected behaviour
Duplicate, Google chose different canonical than userGoogle ignored your canonical and selected a different URL as primaryCheck: absolute URL? No 301? Identical content on both pages?
Duplicate without user-selected canonicalThe engine found similar pages without a canonicalAdd a canonical tag to all duplicate pages
IndexedPage accepted into the index as primary (self-canonical or explicitly chosen)Normal for primary pages

Beyond GSC, verify canonical at the HTTP response level. The quickest method without tools is the browser source view (Ctrl+U → search for canonical) or curl:

BASH
# Check canonical in HTTP header:
curl -sI https://example.com/catalog/?sort=price | grep -i link

# Check canonical in HTML (first 2000 bytes of response):
curl -s https://example.com/page/ | head -c 2000 | grep -i canonical
  • Canonical chains. Page A → canonical B → canonical C. Search engines prefer direct pointers. Make sure the canonical leads straight to the final primary URL without intermediate hops.
  • Canonical pointing to a redirect. A canonical that targets a 301 URL sends an ambiguous signal. The engine has to follow the chain — it's cleaner to point directly to the final URL.
  • Noindex + canonical — a contradiction. A page with both noindex and a canonical sends conflicting signals. Use one or the other: either noindex the page or set a canonical to the primary URL.
  • Canonical via JavaScript. Google can process canonical tags injected by JS, but it's slower and less reliable. Always prefer a static <link> in the HTML <head>.
Quick check without tools: open any page, press Ctrl+U (page source), search for canonical. If the tag is not inside <head> — there's a template issue. If the canonical points to a 404 or an unexpected external domain — critical configuration error.

FAQ

Answers to the most frequent questions about canonical that come up during SEO audits.

Summary

The canonical tag is one of the foundational tools of technical SEO. It is straightforward to implement, yet it regularly causes serious indexing problems when misconfigured or absent on sites with dynamic URL generation. Three core rules — absolute URL, rel canonical https, no chains — fix 80% of possible errors.

Start by checking the current state: GSC → Pages report → filter by "Duplicates" and "Not indexed" statuses. That will quickly reveal where canonical is missing or being overridden by the search engine.

A 301 is a directive: both the user and search engine physically move to the new URL, and the old one stops existing. Canonical is a hint: the user stays on the current URL while the engine only counts the canonical for indexing. Use 301 when a page has permanently moved. Use canonical when the same content is intentionally available at multiple URLs simultaneously.
Yes. Cross-domain canonical is supported by both Google and Yandex. For example, if your article was reprinted on a partner site, ask the partner to add `<link rel="canonical" href="https://your-site.com/article/">`. Google will transfer link equity and content attribution to your domain.
Search engines ignore canonical for several reasons: (1) the canonical URL differs from the duplicate in content; (2) canonical points to a redirect or an unreachable URL; (3) most inbound links point to the duplicate URL rather than the canonical; (4) pages are accessible with and without www without a 301 redirect to the primary version.
Three methods: (1) Page source — Ctrl+U, search for `canonical`. (2) Chrome DevTools — Elements tab, search for `<link rel`. (3) Google Search Console — Pages report → click a URL → in the side panel you'll see both "Google-selected canonical" and "User-declared canonical" fields.
This status does not need fixing — it means your canonical is working correctly: Google recognised the page as a duplicate and is not indexing it. If you want the page to be indexed independently, remove the canonical or replace it with a self-canonical (pointing to itself).