Santiago Juarez
Santiago Juarez

Reputation: 1

Canonical Tag question, on my main page, what should I "href" to?

I have read a lot online by now and can't seem to get the hang of it... what should be my canonical tag for my site, the https://example.com or the https://example.com/index.html?

No matter what I do, Google Search Console says that I did not declare anything as canonical... I have already uploaded a sitemap.xml file, added the <link rel="canonical" href="http://exapmle.com/">, and validated the domain in the server with DNS.

Upvotes: 0

Views: 790

Answers (1)

Tadas
Tadas

Reputation: 353

Answering your question on which one should be canonical tag for your site: https://example.com or the https://example.com/index.html - it depends on which one of these pages you consider the original one.

If https://example.com is your original and you want to tell that to Google Search Engine, then add to this page header <link rel="canonical" href="https://example.com" /> because you still need to have canonical tag for each page, I will explain below why. Then https://example.com/index.html is your duplicate content page. Go to this page header and add <link rel="canonical" href="https://example.com" /> - this will tell Google that https://example.com is your original one.

First off all you need to understand what is Canonical URL. In Google's own words:

A canonical URL is the URL of the page that Google thinks is most representative from a set of duplicate pages on your site.

All pages should have a canonical tag to prevent any possible duplication. Even if do know that you don't have any other versions of a page that are duplicate in terms of it's content, still, just include a canonical tag that links to itself.

It's very easy to have duplicate content without even noticing it. Great example of this, imagine that all inks below display exactly the same content on each page:

https://www.example.com/category/product-a/

https://www.example.com/product-a/

https://m.example.com/product-a/

https://www.example.com/product-A/

Search engines like Google sees this as 4 duplicate pages.

So the best way to you to forget about duplicate content (canonical URL errors) is to use this schema:

  1. All of your pages should have maximum of 1 canonical URL in page header. Example:

    <link rel="canonical" href="https://example.com/" /> Even though you don't have duplicated content - just point original page URL to itself as canonical.

  2. Now, if you have multiple duplicated pages, and let's say your original are https://example.com/ but you also have:

    https://example.com (without / at the end. Yes, this is duplicated content!)

    https://example.com/1/

    Then you go to that pages and do this:

    • in https://example.com page's header add:

      <link rel="canonical" href="https://example.com/" />

    • in https://example.com/1/ page's header add:

      <link rel="canonical" href="https://example.com/" />

Easy as that. Let me know if this answers your question and if you have more questions - I'm happy to help!

Upvotes: 1

Related Questions