The sitemap protocol is well defined here at sitemaps.org.
Yesterday, I configured Movable Type, my blog publishing platform, to automatically generate my own sitemap.xml when I publish a new page or blog entry. I added a custom Movable Type Index Template that would automatically generate a complete sitemap.xml for me, and place it under the root of my blog at http://mark.koli.ch/sitemap.xml.
1- My Sitemap XML Index Template
My custom sitemap XML Index Template is relatively straightforward. In my Movable Type control panel, I clicked "Create index template" on the Blog Templates screen. I named my template "XML Sitemap" and used the following configuration:
<?xml version="1.0" encoding="<$mt:PublishCharset$>"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<!-- blog root -->
<url>
<loc><$mt:BlogURL encode_xml="1"$></loc>
<lastmod>
<mt:Entries lastn="1">
<$mt:EntryModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%S+00:00"$>
</mt:Entries>
</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<!-- pages -->
<mt:Pages lastn="0">
<url>
<loc><$mt:PagePermalink$></loc>
<lastmod><mt:PageModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%S+00:00"$></lastmod>
<priority>0.8</priority>
</url>
</mt:Pages>
<!-- entries -->
<mt:Entries lastn="0">
<url>
<loc><$mt:EntryPermalink encode_xml="1"$></loc>
<lastmod><$mt:EntryDate utc="1" format="%Y-%m-%dT%H:%M:%S+00:00"$></lastmod>
<changefreq>never</changefreq>
<priority>0.6</priority>
</url>
</mt:Entries>
<!-- archives -->
<mt:ArchiveList archive_type="Monthly">
<url>
<loc><mt:ArchiveLink></loc>
<priority>0.4</priority>
<changefreq>never</changefreq>
</url>
</mt:ArchiveList>
</urlset>
Using the sitemap XML protocol defined at sitemaps.org, I configured this template to include my blog root, all pages, all entries, and all archives in the sitemap. I assigned a higher priority to my blog root and individual pages versus the entries and archives. Note that I also omitted the <changefreq> tag under each "page", because I have no idea how often those pages will actually change. Also, I intentionally omitted the <lastmod> tag under each archive page, since again, there's not point in defining the last modified date on an archive.
Of course, you're free to change this template as you see fit as long as it adheres to the sitemap standard.
2- Submit Your Sitemap XML (Submission URL's)
Once you publish your sitemap with Movable Type, you'll probably want to alert Google, Bing, Yahoo and Ask.com that you've got a new sitemap.xml available for your blog. As described here in the sitemap protocol, you can "ping" these web crawlers to alert them of the change. To do so, copy and paste these URL's into a web-browser, and replace <sitemap URL> with the full URL to your new sitemap:
http://www.google.com/ping?sitemap=<sitemap URL>
http://search.yahooapis.com/SiteExplorerService/V1/ping?sitemap=<sitemap URL>
http://submissions.ask.com/ping?sitemap=<sitemap URL>
http://www.bing.com/webmaster/ping.aspx?siteMap=<sitemap URL>
Example:
http://www.google.com/ping?sitemap=http://mark.koli.ch/sitemap.xml
On each submission, you should see some type of successful (HTTP 200 OK) response indicating that your submission was successful. Here's what Google's looked like:
Enjoy!


Did you find this post helpful, or at least, interesting?