Yes, another frustrating experience with MediaWiki. I found by accident a script in the maintenance directory of MediaWiki called genSitemap.php. It seemed to work well enough. Created all the sitemaps per namespace and even an index sitemap to link them all together.
But when I tried to submit it to Google Webmaster Tools I found the catch. The index sitemap file does not comply with Google’s idea of well formed syntax and hence is flagged with errors all over.
The problem is that genSitemap links to the acutal sitemap files relatively, while Google wants absolute URLs. For example:

<loc>sitemap-spottingworld-NS_0-0.xml.gz</loc>

should really be

<loc>http://www.spottingworld.com/sitemap-spottingworld-NS_0-0.xml.gz</loc>

Ok. It was easy enough to fix. But it was another of those “NOTHING works out of the box there” experiences. And more interestingly, I wonder if Wikipedia is using that same maintenance script and thus has not submitted a valid sitemap to Google for a while?!? Questions, questions, and more questions in the absurd world of MediaWiki…

One Response to “MediaWiki and Google Sitemaps”

  1. Jennifer Thompson says:

    Just discovered the post with Google. Tkank you for the info, I can utilise this info.

Leave a Reply