You might have heard the word “canonical” before. What even is a canonical tag, and why is it important for SEO?
A canonical tag, or canonical link element, is an HTML link attribute that is used to tell search engines that they are referencing the correct page, or master version of a page. Telling Google, “hey, don’t look over there, this is the same content and the correct URL is here. Show this one in search results.”
This piece of code references the URL that you want search engines to find and rank. In many cases these will be self-referencing, in others, you will be telling search engines which version of the same page, or duplicate page, is the correct one to rank in search results.
Assignment: Find a Canonical Tag
Try this:
- View the Source Code of the page
- Do a Find Search, command F shortcut, for “canonical”
- If there is one on the page, it will look like this in the HTML code:
Often canonical tags are used to solve for systemic URL structure issues or extensive duplicate content. For example, on a retail site if you have a black dress that lives under the dress category and the black category you might have two product pages with two different URLs but the same exact content.
Writing a Canonical Tag
If your CMS, content management system, does not have a field for a canonical link element, you can code the element into your template. Let’s use the example of the black dress product above to write canonical tags.
URL examples:
www.example.com/product/dresses/black-dress
www.example.com/product/color-black/black-dress
In this case, you would only want Google to find one of these product pages so your site can avoid being flagged or penalized for duplicate content. So, your solution if you want both pages live is to implement canonical tags on both pages. (If you only want one of the pages live, you might use a 301 redirect, to redirect not only search engines but the user to one version of the page.)
Canonical link examples:
To specify that the www.example.com/product/dresses/black-dres URL is the primary URL, you would place the following self-referencing canonical tag on the page:
<link rel=”canonical” href=”www.example.com/product/dresses/black-dress/”>
On the page you do not want Google to show, www.example.com/product/color-black/black-dress, you would add the same canonical tag:
<link rel=”canonical” href=”www.example.com/product/dresses/black-dress/”>
When Google next crawls your pages, it will know to look at the single URL because the content is identical.
Wondering if you should place a canonical on a page? Run through this checklist:
- Do both versions of the page need to be live? If so, yes.
- Is the page content almost 100% duplicate? If so, yes.
- Is this the preferred version of my page I want Google to index and rank? If so, yes.
SEOism: Can I use canonical as a verb? We do all the time. Who’s keeping score anyways.
Warning: relying too heavily on this tag to tell Google which URL is supposed to appear in search results can be problematic. If you are canonicalizing to a URL that is not the same content, chances are Google will overlook these tags, chalking this up to user error.