Canonical URL Complete Guide: All you Need to Know

07/27/2019 2:00 PM by Admin in Seo

Canonical URL Guide: All You Need to Know

canonical url guide

Search engine optimization is important for every website operating on the internet platform. Whether you own a blog site for sharing your views or you sell products from your online store, you need to get your page optimized tactfully.

When it comes to optimization of the page, just targeting your audiences and delivering the best content is not enough. If you want to succeed in this business, you need to be careful about the uniqueness of your URL, as well. To make your portal easily visible on the search engines and avoid duplicate content issues for your website, you can opt for creating a canonical URL of your business.

Internal duplicate content is a major problem for most eCommerce stores and for almost all large sites and which is why Google and other search engines have come up with a solution and that is specifying a particular version of a URL as canonical and search engines will only index that particular version and thus, fixing the issue of internal duplicate content.

What Is A Canonical URL?

The term canonical URL denotes to the HTML link element consisting rel=” canonical”. To make it easier for the search engines, the attribute is mentioned in the header of the page. Canonical URL is the best solution for both internal and external duplicate content issue. The idea is to inform the search engines not index other variants of a web page by including a line of code specifying the preferred version of the URL that you want search engines to index.

In simple terms, this particular type of URL specifies search engines like Google to crawl through a particular website and index the pages under it. Informing search engines about the indexing pages are essential as there can be variations in them based on different factors while the content might be identical or nearly identical. The specification made in canonical URL became live officially in April 2012, when it was termed with a different name. 

To get your website properly optimized, you need to specify the search engines about the version of the web page that you think is ideal. This will prevent the search engines to index the wrong pages with similar content or URL. Yet, you need to note that canonical URL is applicable only when a web page is accessible with multiple URLs or have the same content on multiple pages.

For instance,







For the above set of URLs, you need to first select a URL as canonical. Let’s say we select this – https://www.nicedress.com/ as the canonical URL. In the next step, we will just have to add this following line of code in the head section of all the aforementioned URLs –

<link rel="canonical" href=”https://www.nicedress.com/” />

This above line of code will instruct search engines not index any other variants of the web page and thus eliminating the possibility of internal duplicate content.

Here are some other ways to deal with internal duplicate content -

Adding location hashes - Many must have come across the hashtag trend using # sign in social media platforms. Yet, you may not be aware of the fact that adding location hashes can also help you in creating canonical URL for your online business. The # sign, which is inserted at the end of a fragment highlights a particular section of any page. Just add the hash in the URL of your website and search engines will consider it to one URL only. Thus, the content that you jump off will not be ranked separately or indexed separately by the search engines.

301 Redirect - The status code of 301 redirect prompts any search engine including Google that you intend to make a permanent redirect from a URL to some other URL. A 301 permanent redirection allows you to redirect a URL to another URL so that users don’t get greeted by a 404 Error Page.

Search engine bots also treat 301 redirections the same way. They first crawl the URL A that gets redirected to URL B and pass the link juice accordingly. 301 redirection is thus serving two purposes. First, it is helping people finding the best version of the URL and secondly it is helping search engines to index only one version as other versions are getting redirected to the preferred version.

Canonicalization of URL with Passive Parameters Using Google Search Console- Google Search Console allows users to set URL parameters after your website gets verified. By using this feature, you can direct Google about the parameters that you want to make passive for your website. In other words, it means you can inform Google about the importance of your page and get it indexed accordingly. As canonical urls are a comparatively new concept and many face difficulty in setting parameters for canonicalization, Google Search Console offers tutorial for the assistance of the users.

How Should I Check Canonical Exist Or Not?

There are tools like Screaming Frog or Deep Crawl that you can use to crawl your website and these tools will identify canonical URLs for you if they are at all present on the website. All you have to do is to go through the list generated by these tools and then try to figure out if you have selected any wrong URL as canonical by mistake. However, the same process can be done manually but that would take a really long time. You will have to go through every single URL and then manually look for this code - rel="canonical".

Why Should I Need A Canonical URL?

As you have now become familiar with the basic concept of canonical URL, you might have been able to get an understanding of its benefits. However, in case, you are still not sure of using a canonical URL, you can check the points listed below:

Specify the Right URL

As you set a canonical URL for your website, the search engines, as well as the web traffic, will get automatically directed to the page that you want. For instance, if you are selling a fancy dress and want people to visit


You need to make sure that other variants of the same pages –


Contain the following line of code -

<link rel="canonical" href=”https://www.nicedress.com/best-party-dress/crazy-pink-panda-dress/” />

This will stop search engines from indexing other pages.

To avoid duplicate pages

Almost everyone dealing with online portals is aware of the fact that the search engines do not like any duplicate content on the web and de-ranks the websites using the same information on different pages. With a canonical URL, you can prevent the risks of duplicate content for your site by indexing only the information you desire.

Syndicated content

Canonical URL not only simplifies the task of the visitors and website owners but also it helps the search engine from indexing tons of duplicate pages. With canonical URLs, Google and other search engines can easily consolidate the information that they receive from different paths for the same web page. Thus, the content of the pages are syndicated without many hassles and unnecessary pages are stopped from appearing on the SERP.

To avoid crawling time on duplicate pages

As the search engine, bots are automatically diverted to a single page, there is no risk of getting blacklisted by making the bot crawl duplicate pages of your store.  This, in turn, increases the ranking as well as the credibility of your page.

Canonical URL is a popular topic these days. By setting canonical URL for the web pages of your website, you will be able to guide the search engines as well as visitors about the source of your content, which in turn will help in increasing the ranking of the page. Canonicalization also helps in indicating the formation as well as the organization of the content of your website and highlights how it is different from the other businesses in this field.

How to Fix the Canonical URL's Issue?

Like any other website development and website optimization process, a canonical URL to has the risk of entering different technical issues. Problems with canonical URLs are experienced only when the rel= canonical is wrongly implemented. A mistake in rel=canonical can lead to several issues, including vanishing of the web page from the SERP. However, there are fixes for canonical URL issues as well and you can browse through them if needed.

Use A Canonical Preferred Domain

If the web pages of your website are accessible via both www and non-www formats, it means you are serving two different versions of the same web page and this can lead to internal duplicate content. This can be fixed either by making a 301 redirection or by setting up a preferred domain via Google Search Console.

By setting up the preferred domain, you will instruct search engines to index or to ignore a specific version which is either www or non-www. That specific version, which could either be – www.yourwebsite.com or yourwebsite.com, will be displayed accordingly in the Search Engine Result Pages.

preferred domain

Use A Canonical Link Tag

As we have already explained in the document, the duplicate content issue can be fixed by setting up canonical tag. All you have to do is to specify the canonical URL first and then hard code that thing in the head section of all other variants of the same web page. This will instruct search engines not to index other versions of the same page.

Use 301 Redirects with Help Of htaccess

You might be wondering what the heck this ‘.htaccess’ is. Well, it is basically a configuration file which is used by almost all web server running on Apache. This .htaccess file gets uploaded on the root folder of the website. By making changes in this htaccess file, you can control how your website behaves on the web. You can set redirection code here.

In case, your website has two versions available –

  • With www version – https://www.example.com/
  • Without www version – https://example.com/

You have to redirect the 2nd URL to the 1st URL or vice versa to fix the issue of internal duplicate content. This can be done by adding the following line of code in the .htaccess file –

RewriteEngine on

RewriteCond %{HTTP_HOST} ^example.com [NC,OR]

RewriteCond %{HTTP_HOST} ^www.example.com [NC]

RewriteRule^(.*)$ http://example.net/$1 [L,R=301,NC]

Now, sometimes, the same web page is accessible via the secured version and non-secured version –

  • Secured Version - https://www.example.com/
  • Non-Secured Version - http://www.example.com/

Now, to fix this issue, you will have to add this following line of code in the .htaccess file –

RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

This will redirect all non-secured version of the URLs to their secured (https) counterparts via 301 permanent redirections.

Now, in case, you have to redirect one particular URL to another URL to fix the issue of internal duplicate content, it can be done easily by adding the following line of code –

Redirect 301 /duplicate-page/ http://www.example.com/canonical-version/

Cross-Domain Canonical URL's

This is an amazing feature that allows you to publish the content of your website without getting hammered by Panda update. For example, if you wish to publish an article to a popular magazine that has already been published on your website, now you can do it without adversely affecting the visibility of your website.

Say, for example, you have published your websites on a magazine and the URL is –


And the same article is published on your website –


Now, all you have to do is to ask the owner of the magazine website to add the following line of code in the head section of the web page –

<link rel="canonical" href=”https://www.yourwebsite.com/your-publish-article/” />

This will fix the issue of external duplicate content.


So, we can hope that now you have a better understanding of how to deal with duplicate content by setting up canonical URL using various method to solve duplicate pages and index the right URL using webmaster. This will help the robots to crawl easily and index accordingly.