If you have been accepted in Google News. Congratulations! Your site is good, well designed and you are a lucky webmaster. O.K but… there’s more work to do know. When you receive the email from Google telling you that the site is accepted there are some suggestions there. Google will crawl your site and index the new urls. If you have three digits in the url, then this url will be included in Google news. Okay, that’s the simplest way but you are a professional and you need to do right things and then you want to submit your sitemap using google webmaster tools.
Of course, Google had its useful links but you need an effective method and you don’t want to spend your life reading life and miracles of XML format.
Before we start -the more than obvious thing-: Your site must be accepted on Google News first.
To begin, there are many plugins that promises us a good xml format but don’t believe them because, simply, they doesn’t work. Some of them doesn’t work fine with big sites –and if you are in Google news it’s more than probably that you are the proud owner of a big site-, some of them creates problems with memory usage and PHP or…
This is a valid plugin that creates a valid xml: http://wordpress.org/extend/plugins/google-news-sitemap/
The original plugin is in Italian but it’s also in English then we won’t have any problem using it because we are cosmopolitan people. Let’s download it, let’s install it and let’s activate it in WordPress. Done? Great, take a drink now, we haven’t finished!
Create a file called sitemap-news.php and include there this code:
- header (“Content-type: text/xml”);
- $file = implode(”, file(‘sitemap-news.xml’));
- $file = ereg_replace(“www.nameofyourdomain.com”, $_SERVER[‘HTTP_HOST’], $file);
- echo $file;
NOTE: Please, change ‘nameofyourdomain’ for your domain name. For example ‘yareah.com’. I haven’t changed anything more and it worked for me.
Now, go to robots.txt and add your new sitemap there:
- User-agent: *
- Disallow: /wp-admin/
- Disallow: /wp-includes/
- Sitemap: http://www.mydomain.com/sitemap-news.xml <<<<<<——— this is the important line
Note: Please, don’t copy ‘this is the important line’ or my stupid joke. Copy just ‘Sitemap: http://www.mydomain.com/sitemap-news.xml’ –yes, without quotes-.
Done? Great, you are a genius! Let’s go on. Now go to .httaccess and modify it. .httacess is not a beautiful place in Scotland, no. It’s a file. Add there these lines:
- <IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteRule ^sitemap-news.xml$ /sitemap-news.php [L]
- RewriteRule ^robots.txt$ /robots.php [L]
Create an empty file called sitemap-news.xml, upload it through a FTP program and go to our WordPress admin panel and plugin settings (Settings -> google news sitemap. You have various options, fill them and… done! You have a valid xml file with your news in yourdomain.com/sitemap-news.xml.
Go to webmaster tools, test the sitemap and, if there are no problems, you have it. Note that webmaster tools can be ‘a little’ slow and when I say ‘a little’ I’m being ‘a little’ ironic.
Now you can enjoy the drink and be proud.
Of course, this is not a howto or something similar but this method worked for me. I hope this helps.
That’s all folks!
NOTE: based on this article in Spanish: http://www.artprojectgroup.es/wordpress-y-los-distintos-archivos-de-mapa-de-sitio-sitemap/