What is a canonical tag?
A canonical tag (aka "rel canonical") is a way of telling search engines that a specific URL represents the master copy of a page. Using the canonical tag prevents problems caused by identical or "duplicate" content appearing on multiple URLs. Practically speaking, the canonical tag tells search engines which version of a URL you want to appear in search results.
A canonical tag (aka "rel canonical") is a way of telling search engines that a specific URL represents the master copy of a page. Using the canonical tag prevents problems caused by identical or "duplicate" content appearing on multiple URLs. Practically speaking, the canonical tag tells search engines which version of a URL you want to appear in search results.
Code sample
The problem with URLs
You might be thinking "Why would anyone duplicate a page?" and wrongly assume that canonicalization isn’t something you have to worry about. The problem is that we, as humans, tend to think of a page as a concept, such as your homepage. For search engines, though, every unique URL is a separate page.
For example, search crawlers might be able to reach your homepage in all of the following ways:
1. http://www.example.com
2. https://www.example.com
3. http://example.com
To a human, all of these URLs represent a single page. To a search crawler, though, every single one of these URLs is a unique "page." Even in this limited example, we can see there are five copies of the homepage in play. In reality, though, this is just a small sample of the variations you might encounter.
Modern content management systems (CMS) and dynamic, code-driven websites exacerbate the problem even more. Many sites automatically add tags, allow multiple paths (and URLs) to the same content, and add URL parameters for searches, sorts, currency options, etc. You may have thousands of duplicate URLs on your site and not even realize it.
Comments
Post a Comment