Google Sitemaps using Movable Type

It’s pretty easy to make an XML Sitemap of your blog for easy parsing by Google or other search engines.

Just create a new index template and copy the code below. Choose an output file that is easy to remember such as sitemap.xml. Save and rebuild your new template file once you paste the code.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
<url>
<loc><$MTBlogURL encode_xml="1"$></loc>
<priority>1.0</priority>
</url>
<MTEntries lastn="9999">
<url>
<loc><$MTEntryPermalink encode_xml="1"$></loc>
<lastmod><$MTEntryModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$></lastmod>
</url>
</MTEntries>
</urlset>

Now you need to let Google know where to find your sitemap. Open up your web browser and enter http://www.google.com/webmasters/sitemaps/ping?sitemap= + the URL-encoded location of your sitemap.

That’s it! You can use your Google account to keep track of your pings or multiple sites.

Tags:

25 comments

Commentary on "Google Sitemaps using Movable Type":

  1. Arvind on wrote:

    I’m guessing we add a ping to google in the publicity options in MT too so that Google knows things have changed?

  2. Niall Kennedy on wrote:

    Arvind: No, because it is a different notification method. Movable Type publicity options currently supports XML-RPC pings in the Weblogs.com format only. Movable Type would need to have HTTP Post publicity options with the ability to specify parameters in this case but I think it’s more likely that Google will introduce their own XML-RPC ping beacon with support for extended ping — home page + feed location — as Google Fusion and other products ramp up.

  3. aharden on wrote:

    Niall, thanks for getting something together so quickly. I’ll be using it on my sites this weekend.

  4. Jon Gales on wrote:

    Great start!

    It would be nice to introduce priority for permalinks and add in archive pages. At least on my site, there are a lot more pages that I would like indexed that the index and permalinks (categories, monthly archives, etc).

  5. epc on wrote:

    Do Google require utf-8 or should the first line be changed to use for the character encoding?

  6. The One True b!X on wrote:

    Presumably there’s no way in MT to include modification information for things like index templates? I have a bunch of other pages beyond my entries that theoretically should be included as well, I would think.

  7. Niall Kennedy on wrote:

    You can add MTBlogArchiveURL or a MTArchiveList wrapper with MTArchiveLink link values if you’d like. In my case I have not added descriptions to all my categories so most of what I care about Google finding is at the individual entry level.

  8. Marc James on wrote:

    This isn’t working for me on MT 3.16. http://www.sports-central.org/sitemap.xml

    I created a new index template and used the above code. I’ve rebuilt, as well. But I am getting an error. What am I doing wrong?

  9. JD on wrote:

    Do you know if this will work for TypePad (Pro, of course)?

  10. Coolmax on wrote:

    2Marc James: Change 9999 to 10

  11. Anders on wrote:

    Need to look into how the last modified date can include the date of the last comment instead of the edit date; as comments are what makes individual archive files change over time (& grow more interesting?)

  12. windlike on wrote:

    Google has announced Google Sitemaps, which is a free online service for Webmasters

  13. windlike on wrote:

    Today, Google has unveiled a new Google Sitemaps program allowing webmasters and site owners to feed it pages they’d like to have included in Google’s web index. Participation is free. Inclusion isn’t guaranteed, but Google’s hoping the new system will help it better gather pages than traditional crawling alone allows. Feeds also let site owners indicate how often pages change or should be revisited. Below, a Q&A on the new program with Shiva Shivakumar, engineering director and the technical lead for Google Sitemaps.

    Laptop Batteries Camera Batteries Camcorder Batteries

  14. dakiny on wrote:

    Thank you for Mr.Niall Kennedy.
    Many of my friends including me became fortunate, thanks to Google Sitemaps using Movable Type which you made.
    From now on, please provide a world with good work.
    I am sorry to be awkward English.
    the last — once again — thank you.

  15. Mecandes on wrote:

    Does it also make sense to add the Google Sitemap ping URL to the Movable Type preferences “Publicity/RemoteInterfaces/TrackBack” list? Would that work?

  16. J. P. on wrote:

    Personally, I don’t like TypePad only providing sitemap for Pro membership. I am trying to find a workaround for non-Pro users.
    Some discussion in my blog.

  17. Jon Silvers on wrote:

    Thanks! I barely know HTML, but your instructions were easy enough to follow.

  18. Bryan Buchs on wrote:

    I’m using dynamic publishing for all my templates, including my Google sitemap index. Depending on your server’s PHP settings, the initial “<?” may be identified as a PHP code block. I ended up using this:

    <<?php echo chr(63) ?>xml version=”1.0″ encoding=”UTF-8″<?php echo chr(63) ?>>

  19. ibeblunt on wrote:

    In case anyone wants to make a sitemap for multiple blogs running under MT and you have the plug-in MULTIBLOG installed, you can use the following code:

    1.0
    daily

    daily

  20. ldelavaissiere on wrote:

    If you want to publish a search engine independent sitemap in ROR format, I have compiled a Movable Type template here.

  21. Josh on wrote:

    Thanks! It works perfectly here on MT 3.2.

    Maybe MT should include this by default…

  22. Leo Romanovsky on wrote:

    Thanks! It works great with MT 3.3.

  23. Rostislav Siryk on wrote:

    This work brilliant. I’ve submitted the Sitemap to Google. He accepted it and the asked me to register at its webmasters site to have control over it and see the stats.
    Really nice solution.
    One question I still haven’t got an answer to: how to effectively measure the benefits of site-mapping?