Hi,
If your website has been accepted onto Google news, you’d need to create a special new Sitemap for it. I’ve just finished mine so I thought I’d share how I did it and hopefully someone will find it useful. There are different requirements to an ordinary Sitemap one of which being google only indexes the last 3 days of news and would give you errors in your Google webmaster tools Sitemap if you have entries older than this.
Note:
You will need php turned on and the PHP parsing set to Input
Here’s how it’s done.
1. Create a new template in the root/top level of your website called news-sitemap.
Top level being (depending on your EE setup):
yoursite.com/index.php/news-sitemap/
or
yoursite.com/news-sitemap/
or
yoursite.com/site/index.php/news-sitemap/
etc..
2. Add the following code:
<?xml version="1.0" encoding="UTF-8"?>
<urlset >
<?php
global $LOC;
$start_time = $LOC->decode_date('%Y-%m-%d %H:%i', $LOC->now - 259200);
?>
{exp:weblog:entries weblog=(change_this)" sort="desc" start_on="<?php echo $start_time; ?>" disable="pagination|trackbacks" rdf="off" dynamic="off"}
<url>
<loc>{path=}stories/{url_title}/</loc>
1.0</priority>
<news:news>
<news:publication_date>{exp:stats}{entry_date format="{DATE_W3C}"}{/exp:stats}</news:publication_date>
<news:keywords>{News_Keywords}</news:keywords>
</news:news>
</url>
{/exp:weblog:entries}
</urlset>Note:
This is how I pulled the url to my news, you will need to change this to match your path/setup.
<loc>{path=}stories/{url_title}/</loc>I have a custom weblog field called {News_Keywords} - allowing me to add comma separated keywords on each entry you can do the same or if you have a module such as LG Better Meta, you may be able to use the tags to pull in the keywords automatically.
<news:keywords>{News_Keywords}</news:keywords>3. Sign into your Google Webmaster Tools Account
http://www.google.com/webmasters/tools/
Add submit your news sitemap.
Hope that helps! 😊