Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Test google news sitemap?

Tags:

google-news

How can I test / validate my Googlenews sitemap?

If I go to the search console I have an option to add/test sitemap. However it saying I have an invalid XML tag:

Parent tag: publication Tag: keywords

But I can see this tag is valid so I think the validator is testing it as a normal sitemap not a googlenews specific one: 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>

If I go to the news tools homepage in google its telling me that the site is included in Google News. But how can I check that my sitemap is working correctly?

like image 915
Evanss Avatar asked Nov 12 '15 15:11

Evanss


People also ask

Do you need a Google News sitemap?

If you already have a website sitemap, we recommend that you create a separate sitemap for news content. With a Google News sitemap, you can help Google News: Discover news articles faster: Sitemaps allow Google News to quickly find news articles on your site.


2 Answers

From Google itself: Validating a News Sitemap

The following XML schemas define the elements and attributes that can appear in a News Sitemap file. A News Sitemap can contain both News-specific elements and core Sitemap elements. You can download the schemas from the links below:

For News-specific elements: http://www.google.com/schemas/sitemap-news/0.9/sitemap-news.xsd.

For core Sitemap elements: http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd

There are a number of tools available to help you validate the structure of your Sitemap based on these schemas. You can find a list of XML-related tools at each of the following locations:

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

In order to validate your News Sitemap file against a schema, the XML file will need additional headers as shown below:

<?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>
like image 179
lloan Avatar answered Dec 18 '22 14:12

lloan


The tag is valid but was in the wrong place in the XML structure.

<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>
like image 35
Evanss Avatar answered Dec 18 '22 13:12

Evanss