« XML Sitemap for Movable Type Blog? | Main | www.NewToX10.com »

Google Sitemap again...

Okay, I though a bit more about this whole Google sitemap subject. Two things bugged me about the script I posted yesterday.

A: The script would always show the original creation date as the date of last modification, regardless of comments. Commments often hold important information - except when my graphical merchandiser makes them - , that Google should know about.

B: There was no way to assign Priorities. Some very old post would be just as important as the new index post.

The updated code below changes this. Comments aren't neglected anymore. Also, the blog front page gets scanned daily and has the highest priority(1.0). Then follow the ten most recent entries with a priority of 0.9, then the last "9999" posts with a priority of 0.5.

Again, simply build a new index template and copy and paste the below code. Save it as your-sitemap.xml. To let Google know about it open your browser and enter:

http://www.google.com/webmasters/sitemaps/ping?sitemap= + location of your sitemap

If you have a Google account you may use it to track your sitemap.

Have fun!


<?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>

<MTEntries lastn="1">

<lastmod><$MTEntryModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%S+00:00"$></lastmod>

</MTEntries>

<changefreq>daily</changefreq>

</url>



<MTEntries lastn="10">

<url>

<loc><$MTEntryPermalink encode_xml="1"$></loc>

<lastmod><MTIfNonZero tag="MTEntryCommentCount"><MTComments lastn="1"><$MTCommentDate utc="1" format="%Y-%m-%dT%H:%M:%S+00:00"$></MTComments><MTElse><$MTEntryModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%S+00:00"$></MTElse></MTIfNonZero>

</lastmod>

<priority>0.9</priority>

<changefreq>daily</changefreq>

</url>

</MTEntries>



<MTEntries lastn="10" offset="10">

<url>

<loc><$MTEntryPermalink encode_xml="1"$></loc>

<lastmod><MTIfNonZero tag="MTEntryCommentCount"><MTComments lastn="1"><$MTCommentDate utc="1" format="%Y-%m-%dT%H:%M:%S+00:00"$></MTComments><MTElse><$MTEntryModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%S+00:00"$></MTElse></MTIfNonZero>

</lastmod>

<priority>0.8</priority>

<changefreq>daily</changefreq>

</url>

</MTEntries>



<MTEntries lastn="9999" offset="20">

<url>

<loc><$MTEntryPermalink encode_xml="1"$></loc>

<lastmod><MTIfNonZero tag="MTEntryCommentCount"><MTComments lastn="1"><$MTCommentDate utc="1" format="%Y-%m-%dT%H:%M:%S+00:00"$></MTComments><MTElse><$MTEntryModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%S+00:00"$></MTElse></MTIfNonZero>

</lastmod>

<priority>0.5</priority>

<changefreq>monthly</changefreq>

</url>

</MTEntries>



</urlset>

TrackBack

TrackBack URL for this entry:
http://www.x10community.com/cgi-bin/mt/mt-tb.cgi/55

Comments

This is very interesting site

The code for google site maps shared in the blog is really amazing.

Post a comment