Forum Moderators: phranque

Message Too Old, No Replies

Hreflang tag - multiple cities in same country

         

Juli_Schez

10:57 am on Jan 31, 2020 (gmt 0)

5+ Year Member



Hi guys, I wanted to ask if any of you can help me with a doubt I have regarding hreflang.

So I have a site in English in different countries. Till now it was easy to implement the tag as it was like this:

<link rel="alternate" href="https://madrid.example.com/" hreflang="en-ES" />
<link rel="alternate" href="https://berlin.example.com/" hreflang="en-DE" />
<link rel="alternate" href="https://paris.example.com/" hreflang="en-FR" />
<link rel="alternate" href="https://example.com/" hreflang="x-default" />

But now, we also have a subdomain in Munich. So should i add this in the hreflang code?
<link rel="alternate" href="https://munich.example.com/" hreflang="en-DE" />

I'm asking this because the language and country code is the same for berlin and munich and I don't know if it'll be correct to put both with the same hreflang.

Thank you in advance for your help.

Andy Langton

11:30 am on Jan 31, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hreflang locations are country-level, so cannot be used for cities. Search engines would be likely to ignore one of the hreflang tags.

Personally, I would consider something like de.example.com/berlin rather than a city-level subdomain.

robzilla

11:48 am on Jan 31, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I think you're discovering that using hreflang for this purpose doesn't make much sense. Strictly speaking there's also no such thing as en-DE, en-FR or en-ES, but I suppose Google's documentation on hreflang [support.google.com] would allow it.

However, how exactly does the Munich page differ from the Berlin page? If the content is different (e.g. you're showing local news headlines), then they're not the same page in different languages or aimed at different regions, they're simply different pages. I don't think hreflang fits the bill there.

lucy24

8:52 pm on Jan 31, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Strictly speaking there's also no such thing as en-DE, en-FR or en-ES
Strictly speaking, the bit after the hyphen doesn't refer to dialect, as any rational person would expect it to; it refers to the targeted country, which may be wholly independent of the language. So en-fr might, for example, refer to an English-language ecommerce site with prices in euros.

Fun fact: The CSS construct
element[attribute|=sometext]
was intended for just this situation: en-de, en-gb, en-ca and so on can share a style. But it can also be used with attributes other than lang; I use it with image id to distinguish illustrations from different sources.

robzilla

8:11 pm on Feb 1, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Strictly speaking, the bit after the hyphen doesn't refer to dialect, as any rational person would expect it to

Huh. I always took it to mean language as used in, e.g. English as used in the United States (en-US), as noted here:

Region subtags are used to specify the variety of a language "as used in" a particular region. They are appropriate when the variety is regional in nature, and can be captured adequately by identifying the countries involved, as when distinguishing British English (en-GB) from American English (en-US).

[en.wikipedia.org...]

Apparently that's merely an IETF "best practice".

If it is, in fact, a language-region pair, I suppose theoretically you could use en-DE-BE for the Berlin region. [en.wikipedia.org...]

Munich is going to be tricky. en-DE-BY-err... I quit.

Needless to say, I hope, this hreflang approach doesn't make sense.

Juli_Schez

8:15 am on Feb 3, 2020 (gmt 0)

5+ Year Member



@Andy Langton: I wish we could make the subfolder change instead of having subdomains but that's something that's not going to happen in the near future, that's why I have to look into this hreflang solution.

@robzilla: It has the same content as berlin, the only thing that changes is the region.

I think the best solution here is to either use the berlin page or the munich one but using the both won't make sense.