May 9, 2009 1:23 pm GMT

Creating an automatic news sitemap for a TypePad blog

by Gary Illyes


Google News is one of the most popular news sources on the internet. It is a very convenient way to obtain information about, practically anything which happened in the World. The news is submitted by Google News Publishers, which are either websites like The Guardian is, or simple blog-like websites, just like Devoracles is.

The publishing software used also differs massively: one news publisher uses custom coded engines, others use some open source software like WordPress is, and there are people which use closed source, hosted engines like TypePad is.

Google News finds the articles on the publishers’ websites either by looking at so called “news hubs” – a page which lists in a human-readable way the links to the articles -, or looking at so called “news sitemaps”. The news sitemaps are XML files using a specific markup, which is described and presented here.

Obtaining a news sitemap can be quite difficult with TypePad as you have to get familiar with advanced template tags while with for example WordPress, a news sitemap can be created by simply installing a plugin.

In order to create a news sitemap with TypePad, please follow the below steps:

  1. Log in to your administration back-end, then go to Weblogs >> Design
  2. Click on the Create New Index Template link
  3. In the Template Name field type Google News Sitemap
    In the Output file field type news_sitemap.xml
  4. In the box labeled Template Body copy paste the following code:

    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.google.com/schemas/sitemap/0.9"
    xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
    <MTEntries lastn="10" days="3">
    <url>
    <loc><$MTEntryPermalink encode_xml="1"$></loc>
    <news:news>
    <news:publication_date> <$MTEntryDate format="%Y-%m-%dT%H:%M:%SZ"$> </news:publication_date>
    </news:news>
    </url>
    </MTEntries>
    </urlset>
  5. Save the tamplate
  6. Try to access the sitemap by navigating to http://example.com/news_sitemap.xml, where example.com is your blog’s domain name.
  7. Add the URL of the news sitemap to your Google Webmaster Tool account

There is only one thing which can go wrong, specifically that while copying the code, in a place where shouldn’t a linebreak or whitespace appears. To resolve this issue, just compare the source of your sitemap and the sample which Google provided.


Comments

3 Comments on " Creating an automatic news sitemap for a TypePad blog "

  1. James on Sat, 9th May 2009 5:56 pm  

    Just wanted to say that this works perfectly — no easy trick given that Typepad isn’t the most user friendly blogging system. Thanks Devoracles!

  2. kent on Thu, 28th May 2009 2:22 pm  

    Hi there, do you have a tutorial or some tips doing this on a expressionengine site?

    Best Retgards
    Kent

  3. Gary Illyes on Thu, 28th May 2009 2:25 pm  

    At the moment no. We will create one as soon as I familiarize myself with the software and it’s API

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

If you want to use your OpenID, fill out the field labeled "Website" with the OpenID URL. The other fields may remain empty.
Note that comments are pre-moderated.

Subscribe without commenting





:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: More smilies »