Closed wblondel closed 3 years ago
Hello,
For SEO purposes, it would be great to have the hreflang tags generated when a page is translated.
For instance:
<link rel="alternate" href="http://example.com" hreflang="es-es" /> <link rel="alternate" href="http://example.com/fr/" hreflang="fr-fr" /> <link rel="alternate" href="http://example.com/pt/" hreflang="pt-pt" />
Temporarily, I added this snippet in the layouts\partials\head\link.html theme's file, and it seems to do the job:
layouts\partials\head\link.html
{{ if .IsTranslated }} {{ range .AllTranslations }} <link rel="alternate" href="{{ .Permalink }}" hreflang="{{ .Language.Lang }}" /> {{ end }} {{ end }}
https://yoast.com/hreflang-ultimate-guide/
Great idea, I agree. I will do it in the near future
I will probably transfer it to the discussion, since this is not a bug.
Please next time with ideas there))
Describe the feature you want
Hello,
For SEO purposes, it would be great to have the hreflang tags generated when a page is translated.
For instance:
Temporarily, I added this snippet in the
layouts\partials\head\link.html
theme's file, and it seems to do the job:Useful reference
https://yoast.com/hreflang-ultimate-guide/