Site icon Scott Loftesness

Google Sitemaps for TypePad Pro

I was pulling my hair out last night trying to get a template for creating a Google Sitemap in TypePad for use with our Payments News blog. Unfortunately, the ones that have been posted for Movable Type are subtly incompatible with date formatting in TypePad. As a result, they return errors when published.

Frankly, it’s simply beyond me to understand why neither TypePad nor Google document how to do this (for TypePad Pro users) in either of their online help or FAQ material! Maybe this post will result in one or both of them posting these details – so that others can find these details much more quickly!

Below is the template I ended up using for Payments News. Using it requires a TypePad Pro subscription and a weblog setup for Advanced Templates. You create a new index template – I used the name Google Sitemap and the output file name sitemap.xml. Each time the blog is updated, this template updates the output file. In my blog posting program (MarsEdit), I’ve added a ping to Google to tell it that there’s an updated version of the sitemap.xml file available.

This template is intended to output URL’s for the base Payments News blog, the last 365 days of postings to the blog (for some reason, TypePad actually outputs a lot more posts over a longer period than just 365 days – and trying to use lastn=9999 or some such results in outputting a lot less than 9999 posts), the category archive pages, the monthly archive pages, and the weekly archive pages.

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/xsl/gss.xsl"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">

<url>
<loc><$MTBlogURL encode_xml="1"$></loc>
<changefreq>hourly</changefreq>
<MTEntries lastn="1">
<lastmod><$MTEntryDateModified timezone="UTC" format_name="W3CDTF"$></lastmod>
</MTEntries><priority>1.0</priority>
</url>

<MTEntries days="1000">
<url>
<loc><$MTEntryPermalink encode_xml="1"$></loc>
<lastmod><$MTEntryDateModified timezone="UTC" format_name="W3CDTF"$></lastmod>
</url>
</MTEntries>

<MTArchiveList archive_type="Category">
<url>
<loc><$MTArchiveLink encode_xml="1"$></loc>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
</MTArchiveList>

<MTArchiveList archive_type="Monthly">
<url>
<loc><$MTArchiveLink encode_xml="1"$></loc>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>
</MTArchiveList>

<MTArchiveList archive_type="Weekly">
<url>
<loc><$MTArchiveLink encode_xml="1"$></loc>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
</url>
</MTArchiveList>

</urlset>

Exit mobile version