3

在向站点添加多语言支持后,我遵循了Google 对其 XML 站点地图的建议,将 hreflang 链接合并到备用语言版本。

但是,在这样做之后,我发现各种在线验证器(例如这个)正在返回这些验证错误:

元素'{ http://www.w3.org/1999/xhtml }link':没有匹配的全局元素声明可用,但严格通配符要求

我的站点地图的净化摘录如下。我保留了实际的格式(由于框架如何呈现它而没有整齐地缩进)以防万一:

<?xml version="1.0" encoding="UTF-8" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
    http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
    http://www.w3.org/1999/xhtml
    http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd"><url>
        <loc>http://dev.domain.com/template/en-GB/</loc>
        <lastmod>2017-02-17</lastmod>


        <xhtml:link rel="alternate" hreflang="en-GB" href="http://dev.domain.com/template/en-gb/" /><xhtml:link rel="alternate" hreflang="de" href="http://dev.domain.com/template/de-de/" /><xhtml:link rel="alternate" hreflang="en-PH" href="http://dev.domain.com/template/en-gb/" /><xhtml:link rel="alternate" hreflang="cs-CZ" href="http://dev.domain.com/cz/cs-cz/about-domain/thing" /><xhtml:link rel="alternate" hreflang="af-ZA" href="http://dev.domain.com/cz/cs-cz/about-domain/thing" /><xhtml:link rel="alternate" hreflang="ar-QA" href="http://dev.domain.com/cz/cs-cz/about-domain/thing" /><xhtml:link rel="alternate" hreflang="de-DE" href="http://dev.domain.com/de/de-de/applications" /><xhtml:link rel="alternate" hreflang="x-default" href="http://dev.domain.com/template/en-gb/" />
    </url><url>
        <loc>http://dev.domain.com/template/en-gb/about-domain-en</loc>
        <lastmod>2017-02-28</lastmod>


        <xhtml:link rel="alternate" hreflang="en" href="http://dev.domain.com/template/en-gb/about-domain-en" /><xhtml:link rel="alternate" hreflang="de-DE" href="http://dev.domain.com/template/de-de/uber-domain" /><xhtml:link rel="alternate" hreflang="en-PH" href="http://dev.domain.com/template/en-gb/about-domain-en" />
    </url><url>
        <loc>http://dev.domain.com/template/en-gb/about-domain/thing-en</loc>
        <lastmod>2016-10-20</lastmod>


        <xhtml:link rel="alternate" hreflang="en-GB" href="http://dev.domain.com/template/en-gb/about-domain/thing-en" /><xhtml:link rel="alternate" hreflang="de-DE" href="http://dev.domain.com/template/de-de/uber-domain/thing" /><xhtml:link rel="alternate" hreflang="en-PH" href="http://dev.domain.com/template/en-gb/about-domain/thing-en" />
    </url></urlset>

我看不出 XML 有任何问题,它看起来完全遵循 Google 的建议。我是否可以安全地将其部署到生产环境中,还是在我弄清楚问题出在哪里之前,谷歌会受到惩罚吗?

4

1 回答 1

1

站点地图只能帮助 Google 了解如何抓取您的页面,无论如何都会受到惩罚。如果您没有正确设置它,不会降低您的网站在 SERP 中的当前位置,但它可以使谷歌不知道的一些 URL 不被索引,只要它们没有从任何地方链接。

不同的是,您的 URL 内容不符合 Google 最佳实践,然后您会受到处罚。

于 2018-05-08T14:41:07.903 回答