【问题标题】:What is wrong with my hreflang tags?我的 hreflang 标签有什么问题?
【发布时间】:2018-06-05 20:41:12
【问题描述】:

我最近为我的网站添加了德语支持,现在我想在搜索结果中向讲德语的访问者显示我的网站的德语版本,并向所有其他访问者显示英语版本。我已将此链接标签添加到我的默认页面 (https://example.com/):

桌面

<link rel="canonical" href="https://example.com/">
<link rel="alternate" media="only screen and (max-width:651px)" href="https://m.example.com/">
<link rel="alternate" href="https://example.com/" hreflang="x-default">
<link rel="alternate" href="https://example.com/?hl=de" hreflang="de">

移动

<link rel="canonical" href="https://example.com/">
<link rel="alternate" href="https://m.example.com/" hreflang="x-default">
<link rel="alternate" href="https://m.example.com/?hl=de" hreflang="de">

而这个hreflang标签用于德语版本(https://example.com/?hl=de):

桌面

<link rel="canonical" href="https://example.com/">
<link rel="alternate" media="only screen and (max-width:651px)" href="https://m.example.com/?hl=de">
<link rel="alternate" href="https://example.com/" hreflang="x-default">
<link rel="alternate" href="https://example.com/?hl=de" hreflang="de">

移动

<link rel="canonical" href="https://example.com/">
<link rel="alternate" href="https://m.example.com/" hreflang="x-default">
<link rel="alternate" href="https://m.example.com/?hl=de" hreflang="de">

但是我有一个问题。当我在 Google 上搜索 Youtube 时,它​​只返回德语版的 Youtube (https://www.youtube.com/?gl=DE&amp;hl=de)。但是当我搜索我的网站时,谷歌将我的网站的英文版显示为默认值,将德文版显示为 sn-p。我的代码有什么问题?

【问题讨论】:

    标签: html seo multilingual hreflang


    【解决方案1】:

    根据Google recommendations Duplicate content

    使用顶级域:为了帮助我们提供最合适的文档版本,请尽可能使用顶级域来处理特定国家/地区的内容。例如,与http://www.example.com/dehttp://de.example.com 相比,我们更有可能知道http://www.example.de 包含以德国为中心的内容。

    根据Google recommendations Separate URLs

    桌面版(http://www.example.com/page-1)添加:<link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.example.com/page-1">,移动版(http://m.example.com/page-1)注解为:&lt;link rel="canonical" href="http://www.example.com/page-1"&gt;

    因此,您需要从桌面提示中删除此元链接 &lt;link rel="canonical" href="https://example.com/"&gt;

    【讨论】:

      【解决方案2】:

      你实现了错误的canonical URL

      如果您有一个可通过多个 URL 访问的页面,或者具有相似内容的不同页面(例如,同时具有移动版和桌面版的页面),您应该明确告诉 Google 哪个 URL 对此具有权威性(规范)页。

      桌面移动有不同的网站,以及两种语言englishgerman。它们提供不同的内容,您应该相应地更新规范 URL。

      桌面

      <link rel="canonical" href="https://example.com/">
      

      移动

      <link rel="canonical" href="https://m.example.com/">
      

      桌面德语

      <link rel="canonical" href="https://example.com/?hl=de">
      

      移动德语

      <link rel="canonical" href="https://m.example.com/?hl=de">
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-02-06
        • 1970-01-01
        • 1970-01-01
        • 2020-07-23
        • 1970-01-01
        • 1970-01-01
        • 2010-10-19
        • 1970-01-01
        相关资源
        最近更新 更多