Google News: News Sitemap Examples
As it was announced, Google News has updated its news sitemap format. This document's aim is to provide examples and counter-examples of sitemaps in the new format.
Contents |
Example 1 - The bare minimum
The below example contains only the elements which you must have in a news sitemap and its 'URL' nodes: a 'loc' tag containing the URL of your article, a 'publication' node containing the 'name' and the 'language' tag, the 'publication_date' tag and the 'title' tag. Every 'URL' node has to contain at least these tags
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:n="http://www.google.com/schemas/sitemap-news/0.9"> <url> <loc>http://www.example.com/title/article0001.html</loc> <n:news> <n:publication> <n:name>My News Website</n:name> <n:language>en</n:language> </n:publication> <n:publication_date>1980-01-31</n:publication_date> <n:title>The title of my first article</n:title> </n:news> </url> <url> <loc>http://www.example.com/title/article0002.html</loc> <n:news> <n:publication> <n:name>My News Website</n:name> <n:language>en</n:language> </n:publication> <n:publication_date>1980-02-01</n:publication_date> <n:title>The title of my second article</n:title> </n:news> </url> </urlset>
Example 2 - The advanced sitemap
The below example contains all the possible elements which you can have in a news sitemap and its 'URL' nodes: a 'loc' tag containing the URL of your article, a 'publication' node containing the 'name' and the 'language' tag, an 'access' tag in which you express that the article is accessible only for subscribers or registered users, a 'genre' tag in which you express the genre of the article, the 'publication_date' tag and the 'title' tag, a 'keywords' tag listing the keywords of the article and a 'stock_ticker' tag containing the stock tickers of the financial entities appearing in your article.
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:n="http://www.google.com/schemas/sitemap-news/0.9"> <url> <loc>http://www.example.com/title/article0001.html</loc> <n:news> <n:publication> <n:name>My News Website</n:name> <n:language>en</n:language> </n:publication> <n:access>subscription</n:access> <n:genres>pressrelease, blog</n:genres> <n:publication_date>1980-01-30T13:32:14</n:publication_date> <n:title>The title of my first article</n:title> <n:keywords>some, keywords</n:keywords> <n:stock_tickers>NASDAQ:A, NASDAQ:B</n:stock_tickers> </n:news> </url> <url> <loc>http://www.example.com/title/article0002.html</loc> <n:news> <n:publication> <n:name>My News Website</n:name> <n:language>en</n:language> </n:publication> <n:access>registration</n:access> <n:genres>OpEd, opinion</n:genres> <n:publication_date>1980-01-30T15:32:14Z-05:00</n:publication_date> <n:title>The title of my second article</n:title> <n:keywords>some, other, keywords</n:keywords> <n:stock_tickers>NASDAQ:C, NASDAQ:D</n:stock_tickers> </n:news> </url> </urlset>
Counter Example 1: Missing obligatory tag(s)
In the below example we missed to put in the first 'URL' node a 'title' tag and in the second 'URL' node a 'publication_date' tag. These two mistakes will prevent the news sitemap from being used and Webmaster Tools will yield an "Unsupported format" error for the specific sitemap.
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:n="http://www.google.com/schemas/sitemap-news/0.9"> <url> <loc>http://www.example.com/title/article0001.html</loc> <n:news> <n:publication> <n:name>My News Website</n:name> <n:language>en</n:language> </n:publication> <n:publication_date>1980-01-31</n:publication_date> </n:news> </url> <url> <loc>http://www.example.com/title/article0002.html</loc> <n:news> <n:publication> <n:name>My News Website</n:name> <n:language>en</n:language> </n:publication> <n:title>The title of my second article</n:title> </n:news> </url> </urlset>
Counter Example 2: Malformed tag values and date
A news sitemap, in fact no sitemap should not contain HTML entities. HTML entities like "&" should be removed from the XML or properly encoded. As you can see in the below example, the unescaped ampersand broke the source highlighting as well. The publishing_date tags should contain only date and time values expressed in the supported W3C format. Having these mistakes in your news sitemap will prevent the news sitemap from being used and Webmaster Tools will yield an "Unsupported format" error for the specific sitemap.
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:n="http://www.google.com/schemas/sitemap-news/0.9"> <url> <loc>http://www.example.com/title/article0001.html</loc> <n:news> <n:publication> <n:name>My News&Website</n:name> <n:language>en</n:language> </n:publication> <n:publication_date>1980-01-31</n:publication_date> <n:title>The title of my first article</n:title> </n:news> </url> <url> <loc>http://www.example.com/title/article0002.html</loc> <n:news> <n:publication> <n:name>My News Website</n:name> <n:language>en</n:language> </n:publication> <n:publication_date>Jan 31, 1980</n:publication_date> <n:title>The title of my second article</n:title> </n:news> </url> </urlset>