Technical SEO
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
Year introduced
Google, Yahoo and Bing jointly announced support for rel canonical — the first cross-industry SEO standard
Sites with duplicates
According to Ahrefs, about 60% of sites have pages with duplicated content that need a canonical
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
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.
| Criterion | rel="canonical" | 301 redirect |
|---|---|---|
| Signal type | Hint | Directive |
| User sees | The duplicate page URL | The destination URL (primary) |
| Search engine indexes | Only the canonical URL | Only the destination URL |
| Link equity transfer | Partial (not 100%) | Full (~99%) |
| Both URLs accessible | Yes | No — duplicate returns 301 |
| Use case | Duplicates, filters, pagination | Permanent 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:
<head>
<meta charset="UTF-8">
<title>Laptops — buy at TechShop</title>
<link rel="canonical" href="https://example.com/catalog/laptops/">
</head><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.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.
When to use canonical
Canonical solves six classic content duplication scenarios. Here is each one with real URL examples.
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.
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.
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/.
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.
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.
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.
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
// 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
// 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
<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 status | What it means | What to do |
|---|---|---|
| Alternate page with proper canonical tag | Google accepted your canonical. The duplicate is not indexed; link equity flows to the primary page | All correct — this is the expected behaviour |
| Duplicate, Google chose different canonical than user | Google ignored your canonical and selected a different URL as primary | Check: absolute URL? No 301? Identical content on both pages? |
| Duplicate without user-selected canonical | The engine found similar pages without a canonical | Add a canonical tag to all duplicate pages |
| Indexed | Page 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:
# 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
noindexand 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>.
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.