测试谷歌新闻网站地图



如何测试/验证我的谷歌网站地图?

如果我去搜索控制台,我可以选择添加/测试网站地图。然而,它说我有一个无效的XML标记:

父标记:发布标签:关键词

但我可以看到这个标签是有效的,所以我认为验证器正在将其作为一个正常的网站地图进行测试,而不是谷歌的特定网站地图:https://support.google.com/news/publisher/answer/74288?hl=en#submitsitemap

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
<url>
<loc>
http://www.website.com/page
</loc>
<news:news>
<news:publication>
<news:name>Sitename/news:name>
<news:language>en</news:language>
<news:keywords>Shopping</news:keywords>
</news:publication>
<news:title>Page title here</news:title>
<news:publication_date>2015-11-12T14:16:31+00:00</news:publication_date>
</news:news>
</url>
<url>
<loc>
http://www.website.com/other-page
</loc>
<news:news>
<news:publication>
<news:name>Sitename</news:name>
<news:language>en</news:language>
<news:keywords>Shopping</news:keywords>
</news:publication>
<news:title>
Page 2 title here
</news:title>
<news:publication_date>2015-11-12T12:52:03+00:00</news:publication_date>
</news:news>
</url>
<url>

如果我去谷歌的新闻工具主页,它会告诉我该网站包含在谷歌新闻中。但是我该如何检查我的网站地图是否正常工作呢?

来自谷歌本身:验证新闻站点地图

以下XML模式定义了可以出现在NewsSitemap文件中的元素和属性。新闻站点地图可以包含特定于新闻的元素和核心站点地图元素。您可以从以下链接下载模式:

对于特定于新闻的元素:http://www.google.com/schemas/sitemap-news/0.9/sitemap-news.xsd.

对于核心Sitemap元素:http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd

有许多工具可以帮助您基于这些模式验证Sitemap的结构。您可以在以下每个位置找到XML相关工具的列表:

http://www.w3.org/XML/Schema#Toolshttp://www.xml.com/pub/a/2000/12/13/schematools.html

为了根据模式验证您的新闻站点地图文件,XML文件将需要额外的标题,如下所示:

<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
     xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
       http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
       http://www.google.com/schemas/sitemap-news/0.9
       http://www.google.com/schemas/sitemap-news/0.9/sitemap-news.xsd">
 <url>
    ...
 </url>
</urlset>

标记有效,但在XML结构中位于错误的位置。

<url>
    <loc>
        http://www.website.com/page
    </loc>
    <news:news>
        <news:publication>
        <news:name>Sitename/news:name>
        <news:language>en</news:language>
    </news:publication>
        <news:title>Page title here</news:title>
        <news:publication_date>2015-11-12T14:16:31+00:00</news:publication_date>
        <news:keywords>Shopping</news:keywords>
    </news:news>
</url>

最新更新