Google hreflang语言混淆:我是否必须为页面ITSELF添加hreflang? [英] Google hreflang language confusion: Do I have to add hreflang for the page ITSELF?

查看:135
本文介绍了Google hreflang语言混淆:我是否必须为页面ITSELF添加hreflang?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



Google的 hreflang 文档,在2语言示例中,它表示:


假设您有一个在
http://www.example.com/ 举办的英文语言页面,提供西班牙语替代方案在
http://es.example.com/ 。您可以向Google表明西班牙
网址是英文网页的西班牙语等值三种方式中的一种



但在它的3语言示例中,它表示:


如果您有多个语言版本的URL,则每个语言页面
都必须识别所有语言版本,包括自己。例如,如果您的网站以法文,英文和
西班牙文提供内容,则西班牙文版本除了包含以下内容外,还必须包含rel =alternate
hreflang =x链接链接到法文和
英文版本。同样,英文和法文版本每个
都必须包含与法文,英文和西班牙文
版本相同的参考文献。


以上是3语言网站的示例。我的网站只包含2种语言 - 默认/主要英语和泰语。我必须为页面本身添加 标记吗?谷歌的文档并不清楚这一点,并在其2语言网站的例子中,它没有提到。



例如,这是我在 http://janwawa.com/en/contact.php

 <! -  GOOGLE INTERNATIONAL LANGUAGE TARGETING  - > 
< link rel =alternatehreflang =thhref =http://janwawa.com/th/contact.php>
< link rel =alternatehreflang =x-defaulthref =http://janwawa.com/zh/contact.php>
< / head>

以上是否正确?或者我应该使用:

<! - GOOGLE国际语言定位 - >
< link rel =alternatehreflang =enhref =http://janwawa.com/en/contact.php>
< link rel =alternatehreflang =thhref =http://janwawa.com/th/contact.php>
< link rel =alternatehreflang =x-defaulthref =http://janwawa.com/zh/contact.php>
< / head>


解决方案

如果您打算向他们显示英文页面使用中文的用户,您确实可以使用第二个示例:

 <! -  GOOGLE国际语言定位 - > 
< link rel =alternatehreflang =enhref =http://janwawa.com/en/contact.php>
< link rel =alternatehreflang =thhref =http://janwawa.com/th/contact.php>
< link rel =alternatehreflang =x-defaulthref =http://janwawa.com/zh/contact.php>

新的x-default hreflang属性值向Google的算法发出信号,表明该网页并未针对任何特定语言或语言环境,并且当没有其他页面更适合时是默认页面 - Google


On Google's hreflang documentation, in the 2-language example, it says:

Imagine you have an English language page hosted at http://www.example.com/, with a Spanish alternative at http://es.example.com/. You can indicate to Google that the Spanish URL is the Spanish-language equivalent of the English page in one of three ways:

  • HTML link element in header. In the HTML <head> section of http://www.example.com/, add a link element pointing to the Spanish version of that webpage at http://es.example.com/, like this:

    <link rel="alternate" hreflang="es" href="http://es.example.com/" />
    

But in its 3-language example, it says:

If you have multiple language versions of a URL, each language page must identify all language versions, including itself. For example, if your site provides content in French, English, and Spanish, the Spanish version must include a rel="alternate" hreflang="x" link for itself in addition to links to the French and English versions. Similarly, the English and French versions must each include the same references to the French, English, and Spanish versions.

The above is an example for a 3-language site. My website consists of only 2 languages - the default/main ENGLISH and THAI. Do I have to add the tag for the page itself? Google's documentation is not clear about this point and in its example for 2-language site, it is not mentioned.

For example, this is what I put in http://janwawa.com/en/contact.php

<!-- GOOGLE INTERNATIONAL LANGUAGE TARGETING -->
<link rel="alternate" hreflang="th" href="http://janwawa.com/th/contact.php">
<link rel="alternate" hreflang="x-default" href="http://janwawa.com/en/contact.php">
</head>

Is the above correct? Or should I use:

<!-- GOOGLE INTERNATIONAL LANGUAGE TARGETING -->
<link rel="alternate" hreflang="en" href="http://janwawa.com/en/contact.php">
<link rel="alternate" hreflang="th" href="http://janwawa.com/th/contact.php">
<link rel="alternate" hreflang="x-default" href="http://janwawa.com/en/contact.php">
</head>

解决方案

If your intention is to show them the English page for Chinese speaking users, you can indeed use your second example:

<!-- GOOGLE INTERNATIONAL LANGUAGE TARGETING -->
<link rel="alternate" hreflang="en" href="http://janwawa.com/en/contact.php">
<link rel="alternate" hreflang="th" href="http://janwawa.com/th/contact.php">
<link rel="alternate" hreflang="x-default" href="http://janwawa.com/en/contact.php">

The new x-default hreflang attribute value signals to Google's algorithms that the page doesn’t target any specific language or locale and is the default page when no other page is better suited - Google

这篇关于Google hreflang语言混淆:我是否必须为页面ITSELF添加hreflang?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆