Google Sitemaps

Creating Google Sitemaps
Article by Tom Simondi

 1) Create an XML template. Add a new template and make certain its file extension is .XML. Nothing else much matters. Just make certain the template has the {$ .body $} variable in it and nothing more.

2) In the site root create a new article. Call it what you will; the site name or word sitemap are good alternatives. Don't worry about any file extension; the template will take care of that.

3) Open the article for editing. In the Properties tab select the template you just created for raw XML files. The variable contents are not important; you won't be using them.

4) In the Article tab make certain HTML view is selected and make certain for this article you NEVER select Normal view as that will basically erase all the XML tags. In the article body put the following XML...

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
{$ forEach x in (not (thisArticle)) $}
  <url>
    <loc>http://www.yoursite.com/ {$ x.link$} </loc>
    <lastmod>{$ setDateTimeFormat "*" "yyyy-MM-dd" "" $}{$ x.modifiedDate$}</lastmod>
  </url> 
{$ next $}
</urlset>

...substituting the URL to the root of your website for "www.yoursite.com" in the above.

5) Save and you're done.

When you publish, you will find the article you named as "articlename.xml" in the root directory of your website. As you publish in the future this file will change accordingly with page URLs and modified dates changing as your site changes.

All you have to do then is submit your sitemap to Google and it will be picked up and, if all works as it should, the XML file will be read by the robot scanner and only those files changed will be crawled. This saves Google effort, assures a more accurate and complete crawl of your site, and reduces the load the crawler might put on your server. If other robots pick up this standard the same benefits will apply to them as well.

For more information on Google sitemaps and to create an account see...

http://www.google.com/webmasters/sitemaps/login

CityDesk Home

Fog Creek Home

Email Us