1

So our website supports 3 different languages (RU, EN and LT),

<link rel="alternate" href="http://example.com/" hreflang="lt" />
<link rel="alternate" href="http://en.example.com/" hreflang="en" />
<link rel="alternate" href="http://ru.example.com/" hreflang="ru" />

None of these variations are region specific, do my understanding is that as long as these are in every page, it will do the job?

What I want to clarify though, is part with language selectors, we have 3 links like so:

<a href="http://ru.example.com/" rel="alternate" hreflang="x-default" title="RU">RU</a>
<a href="http://en.example.com/" rel="alternate" hreflang="x-default" title="EN">EN</a>
<a href="http://example.com/" rel="alternate" hreflang="x-default" title="LT">LT</a>

Did I use hreflang attribute correctly in this scenario? Or does it somehow need to reference the link tags in the header somehow?

2 Answers 2

3

You have a three language versions of a URL: in this case, each language page must identify the two other language versions, including itself. So on each language version page you need to do this:

 <link rel="alternate" hreflang="en" href="http://en.example.com/" />
 <link rel="alternate" hreflang="ru" href="http://ru.example.com/" />
 <link rel="alternate" hreflang="lt" href="http://lt.example.com/" />

(source)

For the second snippet you shared, it is not useful for you as you already stated your web page is not region specific. However, I want to fix a small error with your code snippet in case your web page was region specific:

The design is that you need to build 3 language web pages which are region specific plus you add a fourth custom web page for visitors who do not belong to any of those 3 regions. In addition, you'll have to specify the region (ISO 3166-1 alpha-2) in this case. On your custom web page you need to display the language selector.

(source)

1

Language selectors, which, if i understand you correctly, are placed in the body, don't need rel="alternate" hreflang="x-default" constructions. Such are only for the head.

Your snippet

<link rel="alternate" href="http://example.com/" hreflang="lt" />
<link rel="alternate" href="http://en.example.com/" hreflang="en" />
<link rel="alternate" href="http://ru.example.com/" hreflang="ru" />

is correct for sites with the same content in different languages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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