Creating a blog sitemap with Movable Type

December 30th, 2008. This post was published long time ago on the Italian version of my blog then moved here after the English blog has been opened. Please note that the following post can contain outdated information and (probably) multiple typos.

This tutorial targets Movable Type 3.2.

Although the template may work on later versions, you are strongly encouraged to update it according to the specific Movable Type tag syntax provided by your current version.

Movable Type provides an excellent template engine that can be easily tweaked to create a XML Sitemap.

Basically, you just need to create a new index template and ask Movable Type to rebuild it each time your blog is updated.

The Sitemaps Protocol enables you to inform search engine crawlers about URLs on your websites that are available for crawling and helps search engines to find all your pages.

To create a new template enter the Movable Type administration panel.

Blog Dashboard > Templates > Indexes and press Create New Index Template to add a new template to your blog configuration.

Choose an easy to understand Template Name — for example Sitemaps — and an easy to remember file name — for example sitemap.xml.

Configure Movable Type to rebuild the template automatically when rebuilding index templates and fill the Template Body textarea with the following code


<$MTBlogURL encode_xml="1"$> 1.0 daily **** 1.0 daily **** 1.0 daily <$MTEntryPermalink encode_xml="1"$> <$MTEntryModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$> <$MTCategoryArchiveLink$> <$MTArchiveLink$> ``` Please note that bold styled strings must be replaced with your own settings. Save the new template and... your new sitemap file is ready. ![Sitemaps Template]( That's all! Now login into your Google Account, go to the [Sitemaps admin panel]( and submit your sitemap to Google. Before closing this article, let's have a look at the template source code. First of all, according to [Google Sitemap Specifications](, you need to declare the XML file and schema. ```xml ``` Now you are ready to start your URL list. Add your blog main URL using `<$MTBlogURL encode_xml="1"$>` template tag. Set the higher priority value and (if required) the update frequency. ```xml <$MTBlogURL encode_xml="1"$> 1.0 **daily** ``` Then list the Atom and RSS feeds ```xml **** 1.0 daily **** 1.0 daily ``` and all entries. ```xml <$MTEntryPermalink encode_xml="1"$> <$MTEntryModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$> ``` Finally, complete the recipe with all category indexes ```xml <$MTCategoryArchiveLink$> ``` and monthly archives, if they are enabled. ```xml <$MTArchiveLink$> ```

The original tutorial was posted by Nial Kennedy. The code published above is an updated version based on the original post.