0

If I have two websites with same content example.com/de/ - in German, example.com - is in English, and example.at - in German.

so what would be the better option to implement canonical and Hreflang:

Am I right If I do like:

use canonical tag in both sites as self canonical and then also use Hreflang on the same time like:

link rel="canonical" href="http://example.com/"
link rel="canonical" href="http://example.com/de/"
link rel="canonical" href="http://example.at"

link rel="alternate" href="http//www.example.com/de/ " hreflang="de"
link rel="alternate" href="http//www.example.at/ " hreflang="de-at"
link rel="alternate" href="http//www.example.com/ " hreflang="en"

Or there is any other better way to do it? Is there no problem if we use canonical and hreflang at the same time?

Please let me know your thoughts about it.

Thanks, Sahil

1

On example.com use:

<html lang="en">

and

<link rel="canonical" href="http://example.com/" />
<link rel="alternate" href="http://example.com/" hreflang="en" />
<link rel="alternate" href="http://example.com/de/" hreflang="de-de" />
<link rel="alternate" href="http://example.at/" hreflang="de-at" />

On example.com/de/ use:

<html lang="de-DE">

and

<link rel="canonical" href="http://example.com/de/" />
<link rel="alternate" href="http://example.com/de/" hreflang="de-de" />
<link rel="alternate" href="http://example.com/" hreflang="en" />
<link rel="alternate" href="http://example.at/" hreflang="de-at" />

On example.at use:

<html lang="de-AT">

and

<link rel="canonical" href="http://example.at/" />
<link rel="alternate" href="http://example.at/" hreflang="de-at" />
<link rel="alternate" href="http://example.com/" hreflang="en" />
<link rel="alternate" href="http://example.com/de/" hreflang="de-de" />

It will help Google to correctly recognize your language versions.

Additional notes: You can also use this hreflang generator and validate it using this tool. Lang attribute for html tag is needed for Bing.

  • I'm voting this down as 1. 'at' is not a valid language code and 2. it wasn't stated they wanted to target the USA with the main domain or Germany with the de subfolder. – Max Jul 6 '18 at 3:28
  • @Max Please have a look now it is de-at, so it's correct now. For English content it's now only "en" instead of "en-us". It was stated that they want example.com/de/ - in German (please have a look at the very beginning of the post). Could you please +1 back in this case? I also added additional notes. – DiagnoSEO.com Jul 6 '18 at 6:55
  • It's stated in 'German', which means the language, it's not stated they want to target only Germany locale. I'd remove the location tags, leaving only the language. – Max Sep 4 '18 at 8:12

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.