Nothing is for sale here. Freewill tips keep the site running. Want to help? → Tip via Paypal

Canonical URLs Made Easy

I'm guessing most folks don't know what a "canonical URL" is or what that phrase even means.

Briefly, using canonical URLs solves a common problem many webmasters have (and usually don't know they have). Using canonical URLs can help the search engines understand your site better, which can boost your site's search engine rankings.

Got your attention? smile emoji

Here's the thing . . . many web pages and blog posts can be accessed from different web addresses. Before you skip ahead thinking this problem doesn't apply to your site, please keep reading, this does apply to most sites.

Take a quick look at the following website addresses:

	http://www.boogiejack.com
	http://www.boogiejack.com/
	http://www.boogiejack.com/index.html
	http://boogiejack.com
	http://boogiejack.com/
	http://boogiejack.com/index.html

Here’s the problem—all of those URLs are slightly different, and all point to the same page. If canonical URLs aren't used, the search engines treat them as different web pages because the addresses are different, even though they are all the same page.

There can be even more web addresses pointing to the same page. Here are a few examples:

  • If you add a tracking URL
  • Blog posts that are listed in more than one category
  • Shopping carts with dynamic parameters
  • The link prefix http: vs https also represent different pages to the search engines.

All these web addresses, viewed as the different pages by search engines, means your pages are not only competing with other websites, but they are competing with each other for search engine ranking! The problem with that should be obvious. So what happens?

If you use canonical URLs, one page gets all the on-page and backlink SEO juice.

If you don't use the search engines will choose which page is the original, usually based on which one it discovers first, and the rest will be considered duplicate content. Duplicate content is a big no-no.

A search engine bot will only spend a certain amount of time on a site each time it comes around. You don't want them wasting time crawling the same page over and over because it has multiple addresses. With canonical URLs it is immediately redirected to the page you want getting all the SEO juice. That means one page will get it all, and more pages can be indexed.

The Duplicate Content Myth

While true that multiple URLs pointing to the same page can lower your search engine rankings, claiming the search engines "penalize" your site for duplicate content is a myth.

Having read this far you can probably guess what really happens . . . if the search engines don’t consider your duplicate content as spam attempt, which is another issue altogether, they divide the ranking signals between the different URLs, and that can seem like a penalty.

Here's a gross oversimplification of how a page is ranked:

  • http://www.boogiejack.com has four links pointing it.
  • http://boogiejack.com (no www) has six links pointing it.
  • The first URL gets four points, one for each link.
  • The second gets six points, one for each link.
  • If one of those URLs got all 10 points, it would rank better than either of the other two that only have 4-6 points each.

In reality it's no where near that simple, but explaining it like this presents the problem in a way that's easy to understand for everyone.

The important thing to realize is that without canonical URLs no page is getting 100% credit for all the links pointing to it or all the on-page optimization. The so-called duplicate content penalty isn't a penalty at all, it's just a division of the ranking signals among the different URLs a page can be accessed through.

That's where using the canonical URL property comes in. Using it tells the search engines your preferred URL for the page, and knowing this, they funnel all the ranking signals to that page.

How to Use Canonical URLs

There are four basic things to know:

  • Canonical URLs are placed in the <head> section of the page.
  • Use the absolute address of the page. (example to follow)
  • Use the correct prefix: http or https.
  • Use one canonical link per page. There's no reason to use more, but if you do the search engines will ignore them all.

There are two types of canonical URLs, referred and self-reference.

Referral
If page A is your main page, and page B is a duplicate or near duplicate page, place a canonical URL on page B that points to page A. Page B might be a printer friendly page, a page with similar content, a mobile version of the page, an outdated page, or pages with dynamic URLs with parameters such as tracking codes or session IDs. You're essentially referring the search engine to page A so it will get all the ranking signals.
Self-reference
This is where the canonical URL of the page is referenced to itself. This isn't necessary for every page, and, in fact, should be used only where there is a clear need. Needs like this include, but are not limited to: When there are different versions of a URL for the same page due to URL parameters, session IDs, or tracking codes. Mostly used in content management systems where pages are often placed in multiple categories.
In general, canonical URLs should be used in situations where you have multiple versions of the same content, and you want to consolidate the ranking signals to a single preferred version. By doing so, you help search engines understand which version to prioritize and avoid potential SEO issues related to duplicate content.

Place the canonical URL in the HEAD section of your web page. Here's the basic format:

<link rel="canonical" href="https://domain.com/page.html">

There is no closing tag.

You always want to use the absolute (full) address. The above example uses an absolute URL. The alternative, a relative URL, is where the domain name isn't used (example: somepage.html). Using a relative URL can cause crawing and indexing problems.

There are other ways to resolve the duplicate content problem, including the 301 redirect. The canonical URL element is easier for most folks because they don’t have to mess around with the .htaccess file and totally foreign syntax to set up a 301 redirect. If you're curious about that though, I do have a 301 Redirect tutorial.

Now you know more about canonical URLs than (yes, I'm guessing) at least 98% of the people on the planet. You should be full of joy! grin emoji