What is a Canonical Tag

What is a Canonical Tag? A canonical tag is an HTML <link> element found in web page documents that denote the primary version of either duplicate or near-duplicate web pages. This primary URL is what is ranked within search results. If you have multiple versions of the same web page found on different URLs, you…
December 3, 2021

What is a Canonical Tag?

A canonical tag is an HTML <link> element found in web page documents that denote the primary version of either duplicate or near-duplicate web pages. This primary URL is what is ranked within search results.

If you have multiple versions of the same web page found on different URLs, you can tell search engines which URL is going to be the primary or master URL – the one which will be used within search results.

What Do Canonical Tags Look Like?

Canonical tags are placed within the <head> section of an HTML document using a <link> tag. The canonical on my homepage is,

<link rel=“canonical” href=“https://www.edwindanromero.com”/>

Where,

  • link rel=“canonical” states the upcoming link in the tag will be the master version and 
  • href=“https://www.edwindanromero.comis the URL where the canonical version can be found

Why are Canonical Tags Important to SEO?

A canonical tag is important for a few different reasons.

As search engines discover an individual URL, they begin assigning it search engine authority or equity. As duplicate URLs are discovered, the authority assigned to a page may splinter into multiple pages. 

A canonical tag centralizes the authority to a single URL, making the master version stronger and improving its likelihood of performing better.

Additionally, search engines have a crawl budget, or an allowance on how many web pages a search engine bot will crawl for a site. Duplicate web pages eat up a crawl budget faster, leaving less allowance for more important pages.

What if I don’t have a canonical tag

If no canonical tag is found, a site is open to duplicate content, crawl budget and indexation issues.

Google states, if no canonical is found, they will choose one. This may be an issue for webmasters as Google may choose a canonical target that is not ideal.

Identifying Canonicals

To understand whether your site is properly using canonical tags, you can perform a couple of exercises.

Viewing Source Code

On your browser, inspect the source code of your webpage and search for “canonical”. Below you can see the canonical tag when I perform a search on my homepage.

You should be able to discern whether a canonical tag is present right away.

Append a Parameter

Canonical tags help resolve duplicate content issues brought upon by parameter-based URLs. 

The parameter portion of a URL is found after a question mark “?”. Below is a sample parameter URL,

https://www.example.com/?utm=123

Parameter URLs are generated and used as a means to,

  • Site sessions based on channel (e.g. https://www.example.com/?utm=123)
  • Filter pages based on user selection – e.g. colors, sizes, brands, etc. (e.g.https://www.example.com/subfolder/?color=red)
  • Paginated on product list pages (e.g.https://www.example.com/subfolder/?p=2)
  • Internal search pages (e.g.https://www.example.com/subfolder/?search=red+shoes)

If your site uses parameter URLs, you’ll want to look at those pages and inspect its element similar to what we called out above.

Crawl Your Site

Use a web crawler such as Screaming Frog to crawl the entirety of your site and pull the canonical link tag.

With a crawler you’d be able to review all the canonical tags found on your site much quicker and more efficiently.

Below is a crawl of my site and how Screaming Frog was able to pull all canonicals.

Canonical Tag Best Practices

Absolute URLs

Using an absolute URL in a canonical tag refers to using an entire URL path. Looking at another example canonical from, “Building a 301 Redirect Map“,

<link rel=“canonical” href=“https://www.edwindanromero.com/building-a-301-redirect-map/“ />

The entire URL is found in the canonical tag, or the absolute version. This is the preferred approach.

Various sites lean on a relative URL, which only depicts the path of the URL, and omits information such as the root and sub domain. If my site was using relative URLs, the canonical tag would like,

<link rel=“canonical” href=“/building-a-301-redirect-map/”/>

Notice how the canonical tag only contains the URL path and nothing else.

This approach should be avoided. Reason being, your site could still have multiple versions of itself, such as below, 

  • http://example.com
  • https://example.com
  • http://www.example.com
  • https://www.example.com

The relative URL tags don’t denote which is the targeted site; the relative canonical would only state which is the targeted path. Duplicate content issues could still exist.

Secured URLs

Over time search engines have placed a heavy emphasis on secured sites (HTTPS) as a means to protect user information when communicating with a site.

As such, when ensuring your site is using the absolute URLs called out above, you’ll want to use the HTTPS version of your site, in our examples, above, it would be the below URL,

https://www.example.com

200 Status Code Target

When identifying a target for your canonical tag, it’s crucial to use a 200 OK status code target. Doing so will tell search engines that the main version of your webpage is alive and accessible.

As mentioned earlier, if Google finds that your target URL isn’t optimized, including a target that is anything other than a 200 OK, they can decide to neglect what you’ve input as your canonical target. Rather, they will select whichever URL they feel would be best as a canonical.

HTML Canonical Tag

To identify a canonical target, you’d have to use the re=”canonical” tag within the HTML of a webpage, specifically, it’s <head> section.

You would add in the below tag into the <head> section of your document,

<link rel=“canonical” href=“https://www.edwindanromero.com”/>

Sitemap Canonical Usage

Google stated that XML sitemap files should only include canonical targets / the main version of a webpage.

However, they caveat this by stating,

“We don’t guarantee that we’ll consider the sitemap URLs to be canonical, but it is a simple way of defining canonicals for a large site, and sitemaps are a useful way to tell Google which pages you consider most important on your site.”

Based on experience, Google can override the canonical target if they feel there is another version of the webpage that is more suitable for search ranking results. Don’t let this deter you from optimizing canonical tags.

HTTP Head Headers

You’ll also be able to define a canonical target using the HTTP headers of a webpage response. This is extraordinarily beneficial when you’re working with documents where you can’t inject an HTML canonical tag.

PDFs are a great example where you can’t add in an HTML canonical. Instead, you can return an HTTP header that reads,

HTTP/1.1 200 OK Content-Type: application/pdf Link: ; rel=”canonical”

Canonical Tag Mistakes

Canonical tag implementation isn’t without its mistakes.

Similar to how there are canonical best practices, there are areas to avoid when implementing canonical tags. Below are some common issues I’ve seen plague websites in regards to canonical tags.

In cases such as those outlined below, search engine’s visibility into the canonical target may affect organic performance.

Blocking Canonical in Robots.txt

You’ve defined a canonical across duplicates but you’ve blocked the canonical target / main version within robots.txt.

4xx Canonical Target

The canonical target you’ve defined does not exist and search authority points to a location where equity is nulled.

Redirected Canonical Target

You’ve defined a canonical target that redirects to another location. You’ve created an inefficient path to a main version and are causing search engines to exhaust crawl budget resources.

Multiple Canonical Targets

You’ve created multiple canonical targets and Google will be left to choose which one is most suitable for your webpage.

Omitting Canonical in <head>

You’ve created a canonical tag but it is not found in the <head> section of your webpage. Rather, it is found in a location such as the <body> of the HTML document.

Subscribe To #PragmaticSEO

Practical SEO advice. Personal SEO advice.

[Active] Blog Post - Side Bar Newsletter Signup

Reach out

[Active] Blog Post - Side Bar Contact Form