如何测试/验证我的Googlenews站点地图?
如果我转到搜索控制台,我可以选择添加/测试sitemap。但是,它说我有一个无效的XML标记:
父标记:发布标记:关键字
但是我可以看到这个标记是有效的,所以我认为验证器正在测试它作为一个正常的站点地图,而不是googlenews特定的一个: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>如果我去谷歌的新闻工具主页,它告诉我,该网站是包括在谷歌新闻。但是如何检查我的站点地图是否正常工作呢?
发布于 2015-11-18 14:01:21
标记是有效的,但在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>发布于 2015-11-14 18:32:41
来自Google本身:验证新闻站点地图
以下XML架构定义了可以出现在新闻站点地图文件中的元素和属性。新闻站点地图可以同时包含特定于新闻的元素和核心的站点地图元素。您可以从下面的链接下载模式:
新闻特定元素的: http://www.google.com/schemas/sitemap-news/0.9/sitemap-news.xsd.
用于核心站点地图元素的: http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
有许多工具可以帮助您根据这些架构验证站点地图的结构。您可以在以下每个位置找到与XML相关的工具列表:
http://www.w3.org/XML/Schema#Tools http://www.xml.com/pub/a/2000/12/13/schematools.html
为了根据模式验证您的News Sitemap文件,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>https://stackoverflow.com/questions/33674760
复制相似问题