2

I have a confusion in implementing canonical URLs;

Client has shared a set of URLs like;

http://example.com/eg/
http://example.com/eg/index?32312323
http://example.com/eg/index?54545545
http://example.com/eg/index?45554455

What I did to make them canonical I have added below tag on each of the above page header;

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

I have following questions:

  1. Do implementation is right?
  2. If yes; google will take care of rest like content duplication issue etc?
  3. Any further improvement or any better alternative?

Please do let me know if I am not clear

Thanks

  • A canonical tag is designed to indicate which is the original content in a case where there is duplicate content. For that reason, the canonical tag must point to the original always. – closetnoc Feb 16 '16 at 22:41
  • Its means implementation is correct? as client wanted to refer everything to <link href="http://example.com/eg/" rel="canonical"> – Aamir Shahzad Feb 16 '16 at 22:44
  • That would be an incorrect implementation - completely. At the very least, the page should refer to itself. If you have duplicate content, the canonical tag should refer to the original. It should never refer to another page that is completely different. – closetnoc Feb 16 '16 at 22:47
  • @closetnoc all of the pages are the same there is one main page i.e. http://example.com/eg/ – Aamir Shahzad Feb 16 '16 at 22:52
  • 1
    I am not sure why I did not see it the way you intended it. Working off of 3.5 hours sleep - but that cannot be it - can it?? Cheers!! – closetnoc Feb 16 '16 at 22:57
3

If the following URL's output exactly the same code:

http://example.com/eg/
http://example.com/eg/index?32312323
http://example.com/eg/index?54545545
http://example.com/eg/index?45554455

And of all the URLs, you want to see the following URL in search engines:

http://example.com/eg/

then edit your scripts so that this line:

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

is between <head> and </head> in the code produced from each of these URLs:

http://example.com/eg/index?32312323
http://example.com/eg/index?54545545
http://example.com/eg/index?45554455

By adding that tag, you declared the code in the above three URLs an exact copy of the code in this URL:

http://example.com/eg/

You don't need to declare canonical inside:

http://example.com/eg/

because you designated that URL as the original content URL.

|improve this answer|||||
  • You mean there is no need to add <link href="http://example.com/eg/" rel="canonical"> on http://example.com/eg/ as its original page right? – Aamir Shahzad Feb 16 '16 at 22:55
  • That's right. Doing so will confuse the heck out of google because the href in the link tag points to the URL of the original copy of all the copies of the page. Never declare the original copy as a copied page. – Mike Feb 16 '16 at 23:00
  • 3
    Google will not confuse if you place canonical link tag on original page as well. I disagree with mike. – Goyllo Feb 17 '16 at 7:42
  • @Goyllo do you have any ref. for this. That will be helpful. Thanks – Aamir Shahzad Feb 25 '16 at 4:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.