On the blog here, I use the great Google Sitemaps XML plugin for WordPress by Arne Brachold (available from his site at http://www.arnebrachhold.de/projects/wordpress-plugins/google-xml-sitemaps-generator/) to automatically generate my sitemaps. Since moving to Windows Azure for my hosting I’d been having a problem with it automatically building the file on site changes. The fix was actually really simple but I completely overlooked it initially.
First off, this plugin is great for two reasons and credit to the author. It’s really customizable allowing you to configure what is included in the sitemap and what is not such as categories, tags, archives, search page and you can even specify individual post IDs. This is all so that you can match your sitemap.xml to your robots.txt configuration to help Google and Bing (and yourself for SEO) but more importantly longer term because it automatically rebuilds and notifies Google and Bing when it is updated by means of new or updated posts being published. As a blogger, all I have to worry about is finding the time amongst work and life to think of something awesome to post and for you all to read.
It goes without saying that Windows Azure web instances are running on IIS and in counter, the plugin is designed primarily for Apache installations. The reason I hadn’t thought of this previous before now is that my last host was running IIS too and I had no problems with it there.
Head over to the settings panel for the XML-Sitemaps plugin in your WordPress admin site and scroll down to the area titled Location of your Sitemap File. The installation tries to select an automatic location from the web server paths. Credit to it, it got the paths right, but the direction of the slashes wrong and it turns out that this was the problem.
Change the setting to Custom Location and simply replace all of the forward slashes in the path with backslashes. Hit the Update Options button at the bottom and you’re done. I submitted a very short hello world post after the change to test it and once published, go to the XML-Sitemaps panel and I was given a message to show that the sitemap will be rebuilt in 10 seconds and sure enough after 10 seconds, it rebuilt and notified Google and Bing as designed of the changes.