A canonical URL or “canonical link” is an HTML element that helps search engines avoid the appearance of duplicate content. It does this by identifying a preferred version of a web page. Using canonical URLs improves your site’s SEO and makes searching the site easier for your visitors. The canonical link appears in the head section of a web page and looks like this:
<link rel=”canonical” href=”http://www.yoursite.com/page-path/page-title/” />
How it works
Imagine you’re throwing a party at your home and you provide directions to your guests. (I recognize that nowadays people will just plug your address into their navigator, but my father refuses to use such technology and still prefers written directions and paper maps.) Knowing that your guests will be coming from different starting points, you provide a different set of directions whether they are coming from the north, east, south, or west. Each set of directions presents a differt route, but each ends up at your house.
Now consider that you publish a news story to your website, and your website allows your visitors different paths to get to news stories. One path may be to navigate to a menu choice “News” and click the link to your story. Another might be to click a link from a section titled “Latest News” on your home page. A third might be that your visitor navigated to some other page and saw the link to your news story in a side bar of related content. This could result in three different URLs:
No matter how visitors navigate to your news story, they will end up reading the same content, even if the URL and the appearance of the web page around the storyare different based on how they got there. Likewise, the different directions you offer your party guests will result in them all arriving at your home regardless of which route they took. The directions you provided your guests are like your web pages and your home address is like the canonical URL! There are different ways to get there, but only one home. Following through with the news story example, each of the pages above should have the same canonical URL. It might look like this:
<link rel=”canonical” href=”http://www.yoursite.com/news/archives/story-title/” />
Search engines crawl through links on your site just like humans only [very much] faster. That means that Google will find all three paths to your news story just as visitors will. Should it show all three results? No, instead when it sees the canonical URL – common to all three pages – Google presents that one. In doing so, Google avoids the appearance of duplicate content and your website visitors are not confused by multiple links to the same story. That’s why canonical URLs are important.
The canonical link element was introduced in 2009 by consensus among the major search engines Google, Yahoo! and Bing. It was formally added as an HTML standard in 2012 and is now an expected feature of all modern content management systems.