Xml sitemap – quick introduction

Submitting an xml sitemap to Google webmaster tools is recommended way to get site urls indexed by Google. This helps google to reach various urls easily. This also let you specify priorities to urls and update date.

Sitemap format

Sitemap is usually located at /sitemap.xml but it can be at a different location also. It can also be compressed and in that case usually located at /sitemxp.xml.gz. Here is sample sitemap content:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
  <loc>http://infoheap.com/</loc>
    <lastmod>2013-07-11T18:39:55+00:00</lastmod>
    <changefreq>daily</changefreq>
    <priority>1.0</priority>
  </url>
</urlset>
It is usually better to submit compresed (gzipped) sitemap as it will save bandwidth and can be served faster. In case the sitemap is not big, it does not matter that much.

Multiple sitemaps

You can also create and submit muliple independent sitemaps. This may be useful for large sites. You can also create and submit sitemap index files. A sitemap index file contains pointers to other sitemaps. Here is a sample sitemap index file:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.google.com/schemas/sitemap/0.84">
 <sitemap>
    <loc>http://example.com/sitemap1.xml</loc>
    <lastmod>2013-07-13T18:23:17+00:00</lastmod>
 </sitemap>
 <sitemap>
    <loc>http://example.com/sitemap2.xml</loc>
    <lastmod>2013-07-13</lastmod>
 </sitemap>
</sitemapindex>
I think it is better to avoid sitemap index files if total number of urls is small (less than 10K or so).

WordPress and url priorities in sitemap

It may be a good idea to specify priorities in wordpress for various urls. But we should not keep too many priority values. I would suggest keeping priority 1 for posts and pages and keep it a lower value for tags and categories pages.

Submit sitemap in Google webmaster tools

These are the quick steps to submit a sitemap in Google webmaster tools:

  1. First login to webmaster tools and goto crawl -> sitemaps from left menu links:
    google-webmaster-tools-sitemap-menu-link
  2. The click on add/test sitemap and enter the sitemap location as shown below:
    google-webmaster-tools-sitemap-add-test
  3. You can test the sitemap before adding it. That checks the xml file syntax and also generates a report containing number of urls in the sitemap as shown below:
    google-webmaster-tools-sitemap-test-complete-msggoogle-webmaster-tools-sitemap-test-complete-results
  4. If the sitemap passes the test, then you can submit it and it will appear in sitemap list as shown below:
    google-webmaster-tools-sitemap-list

Reloading sitemap

Sitemap can be reloaded by two ways:

  1. It can be resubmitted thought Google webmaster tools. To do that click on the sitemap in the sitemap list and then on sitemap details page, click on resubmit as shown below:
    google-webmaster-tools-sitemap-details-with-resubmit-link
  2. It can be resubmitted by hitting the following url
    http://www.google.com/webmasters/sitemaps/ping?sitemap=http://sitename.com/sitemap.xml.gz"

 

Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit

Comments

Click here to write/view comments