How to construct an XML site map for your mobile website

by Sriraj on January 4, 2010

Seeing the reports of Admob, a mobile advertising network, it is very evident that the number of people using mobile phones (or touch devices like iPods) to surf the web is growing leaps and bounds every month. In this case, it is so very essential for a webmaster to have his mobile site ready for the next revolution.

While this post doesn’t explain how to create a mobile website, it’ll definitely concentrate on building a Google compliant XML sitemap for your mobile site.

The best place to start is to look at Google’s own mobile sitemap.

XML Mobile sitemap Schema

Similar to the schema of a web sitemap, an XML mobile sitemap to has a schema as follows (broadly concentrating on Google mobile bot)

<?xml version=”1.0″ encoding=”UTF-8″ ?>

<urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″

xmlns:mobile=”http://www.google.com/schemas/sitemap-mobile/1.0″>

The next set of instructions will be the ‘urlset’ and the ‘loc’ of the webpage, just similar to the web sitemap. The only change in the making of a XML mobile sitemap will be the addition of the line

<mobile:mobile/> to every location

Adding the URL locations

Your site map will now look something like

<?xml version=”1.0″ encoding=”UTF-8″ ?>

<urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″

xmlns:mobile=”http://www.google.com/schemas/sitemap-mobile/1.0″>

<url>

<loc>http://www.sriraj.org</loc>

<mobile:mobile/>

</url>

</urlset>

Few touch-up’s to complete

Also it is highly recommended(but not mandatory) to add the ‘priority’, ‘last modified’ and ‘change frequency’ lines to the above sitemap.

So finally your XML mobile sitemap will look like:

<?xml version=”1.0″ encoding=”UTF-8″ ?>

<urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″

xmlns:mobile=”http://www.google.com/schemas/sitemap-mobile/1.0″>

<url>

<loc>http://www.sriraj.org</loc>

<lastmod>2010-01-03T03:20:38+00:00</lastmod>

<changefreq>daily</changefreq>

<priority>1.0</priority>

<mobile:mobile/>

</url>

<url>

<loc>http://www.sriraj.org/category/wordpress/</loc>

<lastmod>2010-01-02T03:20:38+00:00</lastmod>

<changefreq>weekly</changefreq>

<priority>0.8</priority>

<mobile:mobile/>

</url>

.

.

.

.

</urlset>

When you’re done save the file as say mobsitemap.xml and upload it to the root folder on your server, and if needed, you could also submit the same to Google using webmaster tools.

If your website has too many pages to do it manually, you may consider a 3rd party mobile sitemap generator to do the work for you

There are many free XML sitemaps for web out there, like this for wordpress powered sites, which you could use for your normal website and add the line <mobile:mobile/> to each URL.

You can look at my mobile sitemap to get a fair idea.

Visitors who read this article also read:

  1. Google sitemap guidelinesEver since Google introduced sitemaps,it  set  very strict guidelines in the making of a sitemap. For your sitemap (which ever...
  2. xml-sitemap error, make sure the file exists and is writableIf you got the above message when trying to implement the XML sitemap, then you have the solution here. I’m...
  3. Sitemap.xml error URL timeout:robots.txt timeoutI recently came across this error when I logged onto my webmaster tools.I searched the web to find out the...
  4. Submit sitemaps for blogger,wordpress for better indexingFor a better SEO, in the last post is explained how to use the image ALT tags. One such technique...
  5. Webmaster community in OrkutOrkut is a social networking site that most of us use here in India and no wonder that is the...
  6. www or no-www in a website URL?www or no www? Enforce www preference plugin for WordPress If you are in a dilemma whether to use www...

Leave a Comment

Copyright © 2008-10.Sriraj Digital Magazine.