The canonical tag (rel="canonical") is an HTML signal that tells the search engine, "the
main, preferred version is this one" when the same or very similar content exists at more than one address. Used
correctly, it consolidates the signals of duplicate addresses onto a single page; used incorrectly, it can cause
your important pages to drop out of the index. In this guide we cover what the canonical tag is, when to use it,
how to write it, and the most common mistakes, with examples.
What is a canonical tag?
A canonical is a single-line link tag placed in the <head> section of a page:
<link rel="canonical" href="https://www.ornek.com/ayakkabi/spor-ayakkabi/" />
This tag provides the information that "the address representing this page's content is this one." When Google finds several addresses that lead to the same content, it groups them together and selects one of them as the canonical URL. Your canonical tag is a strong hint in this selection, but it is not a binding command.
Why is it needed? The duplicate URL problem
The same page can be opened from different addresses, and most site owners are not aware of this. For example:
http://example.com/product,https://example.com/product,https://www.example.com/productandhttps://www.example.com/product/- Sorting, filter, or tracking parameters:
/product?sort=price,/product?utm_source=newsletter - Session IDs or print versions
- The same product opened under different addresses within several categories
- The same content published on other sites (syndication)
In this case Google chooses which address to index on its own; the address it picks may not be the one you want. In addition, because internal and external links are spread across different addresses, signals are split and crawl budget is spent on unnecessary copies. The canonical tag gathers this scattered signal back together.
How is it written?
A canonical can be declared in three places:
| Method | When? |
|---|---|
<link rel="canonical"> HTML tag | The standard method; it must be inside <head>, it does not work in the body. |
HTTP Link header | For non-HTML files, such as PDFs. |
| Sitemap | A weak hint; it is the least preferred method, but to keep signals consistent, include only canonical URLs in the sitemap. |
Writing rules:
- A page should have one canonical tag; more than one leads Google to ignore all of them.
- The address should be absolute (including protocol and domain); relative addresses are error-prone.
- The address should lead directly to a page that returns 200 and is indexable. An address that redirects, returns 404, or is noindex should not be shown.
- Your preference for lowercase/uppercase, the trailing slash, and www should be applied consistently.
When should it be used?
1. Self-referencing canonical on every page
Even when there seem to be no duplicates, it is good practice for each page to show its own clean address. Even if someone
adds a parameter such as ?utm_source=... to your page, Google still knows the main address.
2. Parameterized addresses
Give the canonical of addresses generated by sorting, filter, and tracking parameters to the main page without parameters. However, if a filtered result corresponds to a genuinely separate search demand (e.g., "black sports shoes"), you may consider leaving that page with its own address; this decision depends on whether the page carries its own content value.
3. The same content on different sites
If you also publish your content on another site (a partner, news syndication), you can ask the other site to place a canonical on its page pointing to the original version. Implementation is up to the other party, and Google still treats it as a hint.
4. Pagination
In paginated lists (category page 2, 3, ...) each page should show its own address as canonical. Giving all pages a canonical
to the first page makes it harder to discover the products on later pages. Google has stated that it no longer uses the
rel="prev" and rel="next" markers for indexing.
5. Separate versions such as mobile and AMP
On older structures with a separate mobile site (m.), the mobile page canonicalizes to the desktop version, and the desktop
page points to the mobile one with rel="alternate". If you use responsive design, you do not need this complexity.
Caution on multilingual sites: Do not canonicalize different language versions to each other. Each language version should canonical to its own address, and the relationship between languages should be set up with hreflang. Otherwise, Google keeps only one version in the index and the others remain invisible.
It is also important to know the limits of the canonical. The tag is meaningful only for identical or very similar content. If the content of two pages is significantly different, canonicalizing one to the other leads Google to ignore the tag; moreover, regardless of your intent, it can cause a valuable page to drop out of the index. Think of the canonical not as a "cleanup button," but as a tool for consolidating genuine duplicates.
Worked scenario: a filtered category page
Suppose the "Sports shoes" category in a shoe store can be opened at these addresses:
/sports-shoes/(the main page)/sports-shoes/?sort=price-asc/sports-shoes/?color=black&size=42/sports-shoes/?utm_source=newsletter
These four addresses show the same product list (or a subset of it). The correct approach is this: all of them should have a
canonical pointing to https://www.example.com/sports-shoes/; internal links and the sitemap should use only this
clean address; and tracking parameters should be managed separately in reporting tools. With this setup, the dozens of addresses
generated by sorting and colour filters contribute to the main page instead of splitting its signals.
On the other hand, if you have produced a separate page with a unique title and content for a combination that is genuinely searched for, such as "black sports shoes," that page should canonical to its own address. The criterion is simple: if a page is unique and useful enough to meet a search demand on its own, it should have its own canonical; if it merely shows the same list in a different order, it should point to the main page.
Rules for correct use
- Resolve duplicates with redirects first. For addresses users should never reach (http, the non-www version), a 301 redirect is stronger and more definitive than a canonical. A canonical is used only when both addresses must remain accessible.
- Point internal links to the canonical address. In menus, breadcrumbs, and in-content links, use the parameter-free, preferred address. For internal linking strategy, see our internal linking guide.
- Include only canonical addresses in the sitemap. For details, see our XML sitemap guide.
- Do not produce conflicting signals. The canonical, hreflang, redirects, and internal links should all point to the same address.
- Be careful when changing it with JavaScript. Where possible, deliver the canonical server-side, in the initial HTML response.
Common mistakes
| Mistake | Result | Fix |
|---|---|---|
| Canonicalizing all pages to the home page | Inner pages may drop out of the index | Each page should point to an address matching its own content |
| Using canonical and noindex together | Two conflicting signals; it becomes unclear which will be applied | Choose one: canonical to consolidate, noindex to keep out of the index |
| The canonical address redirects or returns 404 | The tag is ignored | Point to an address that returns 200 directly |
Writing a relative address (href="https://hitbot.org/product") | It may resolve to the wrong address | Use an absolute address |
Placing the tag inside <body> | The tag is ignored | Move it inside <head> |
| Blocking canonicalized duplicates with robots.txt | The bot can never see the canonical | Keep the duplicates open to crawling |
We explain the difference between blocking crawling with robots.txt and using a canonical in detail in our robots.txt guide.
How do you check the canonical?
- Page source: Open the page's source code in your browser and search for "canonical"; there should be one single, correct line.
- Search Console URL Inspection: When you inspect an address, "User-declared canonical" and "Google-selected canonical" are shown together. If the two differ, Google has not accepted your choice; look for the reason in content similarity and conflicting signals.
- Pages report: Statuses such as "Alternate page with proper canonical tag" and "Google chose a different canonical than the user" reveal the problem. Our indexing problems guide helps with interpreting this report.
- Crawling tool: A tool such as Screaming Frog lists missing, multiple, and conflicting canonicals across the whole site.
For the official explanation, see Google Search Central's document on consolidating duplicate URLs. The canonical is one item in a technical health check; for all items, use our technical SEO checklist.
Frequently asked questions
Does a canonical tag replace a 301 redirect?
No. A 301 moves both users and bots to the new address, while a canonical states your preference while both addresses remain accessible. If the old address should no longer be used, prefer a 301.
Why does Google ignore my canonical?
Because the tag is a hint. If the pages are genuinely different, the canonical address is wrong, or internal links and the sitemap point to another address, Google makes its own selection.
Is it mandatory to add a self-canonical to every page?
It is not mandatory, but it is recommended. It is a simple safeguard against parameterized or differently written addresses appearing.
Does a canonical improve rankings?
Not directly. By consolidating signals and preventing confusion, it helps the page achieve the performance it deserves.
Conclusion
The canonical tag is a simple but effective tool that removes the ambiguity created by duplicate addresses. Add a tag to each page pointing to its own clean address, consolidate parameterized copies to the main page, avoid producing conflicting signals, and verify the results in Search Console. Where duplicates can be removed definitively, a 301 redirect is always the clearer solution. As your next technical step, you can move on to our structured data guide to describe your pages better to machines.