The problem with many sites is that they have pages that are identical or nearly identical. This can happen when your site has many categories, paths, and dynamic data.
The solution is to use the canonical tag. The canonical tag is a tag used to tell search engines which version of a page is the desired or preferred version.
You want to be clear to search engines which version of the page they should index because if you have many versions of the same page then that page is unlikely to rank well at all.
Canonical Tag in Action
The canonical tag is placed in the header of your HTML file and it looks like this:
- <link rel=”canonical” href=”http://www.yoursite.com/some-page” />
Take a look at the following URLs:
- http://www.yoursite.com/nike/shirts/awesome-shirt?size=large&color=green
- http://www.yoursite.com/nike/awesome-shirt?size=small&color=orange
- http://www.yoursite.com/nike/clothing/shirts/awesome-shirt?size=xxl&color=red
- http://www.yoursite.com/brand/nike/clothing/shirts/awesome-shirt
Notice what is happening here; our product awesome-shirt has many options for colors and sizes and it also has different paths to reach the same page. This is not uncommon with e-commerce sites that have many paths that a user can take to get to the same page.
For this example we have decided that we need to use the canonical tag. The canonical tag we build will look something like this:
- <link rel=”canonical” href=”http://www.yoursite.com/nike/shirts/awesome-shirt” />
We are sending search engines a clear message that for this particular product, no matter which size or color, no matter how the product is categorized- you can find it at the canonicalized URL.
Tips and Best Practices
The canonical tag is so easy to use that you need to be sure that you do not forget best practices.
- Make sure all your canonicals are working as you want them by viewing the source code for all of your pages. Test test test!
- You still need to use a clean URL structure.
- Don’t use the canonical tag to cover up problems if you don’t have to, fix the problems and use the canonical tag when needed.
- Only use the canonical tag if the pages are actually identical or nearly identical. They should be basically the same page in order to use the canonical.
Still have questions? Google does a pretty good job with their canonical tag overview.