Introduced in the earliest days of the web, site maps were traditionally an overview, often in list format, of pages in a website, with links to each page. HTML site maps are still around – Apple’s site map is a good example – and are still useful to visitors for a website with more than a dozen or so pages. (If your site has nine or fewer pages, every page should be linked to every other, precluding the need for a site map).
However, traditional site maps have several drawbacks:
- As static HTML pages, they are a pain to keep updated, especially on a busy site: every new page that is uploaded to the site must also be entered as a link on the site map page. (This can be alleviated to some degree by utilizing PHP or another server-side language).
- In complex and dynamic sites, files that are missing from the site map and not linked to from any other page might be missed by search engines when they index the site.
- Traditional Sitemaps (note the capital S) give no indication of the relative importance of pages, nor how frequently they are changed or updated.
- They also do not list resources, such as images and video, that have become vital to web searches.
The answer to these problems are XML site maps (note the lowercase s). These site maps are not intended to be read by visitors: rather, they are guides for search engines to the resources on your site. XML site maps are supported by Google, Bing, and Yahoo.
I will use a portion of the site map for this site as an example:
<?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"
xmlns:image="http://www.sitemaps.org/schemas/sitemap-image/1.1">
<url>
<loc>http://thenewcode.com/217/CSS3-Vendor-Prefixes</loc>
<lastmod>2010-11-14</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
As you can see, the xml site map goes into far greater depth than a standard traditional Sitemap, and supplies far more information that is useful to a search engine. It is important to note that priority
is not an indication to the search engine on how high to rank your page, but on the page’s relationship to the purpose of the site as a whole.
Obviously writing a complete XML site map is a serious undertaking for a even a moderately complex website. Fortunately there are tools to help you:
- The sitemaps.org website provides a good overview of the site map schema.
- XML-Sitemaps can automatically generate a free site map for your site, covering up to 500 pages. (It does not include images or videos by default – that is a paid option).
Once your site map is complete, upload it to the root of your site (typically with the filename sitemap.xml), alongside your index page. While search engines should find the file automatically and use it to help index your site, there is nothing wrong with directing Google, Bing and Yahoo to your site map in order to prompt an indexing attempt, or when the file changes significantly.
- Google can be alerted about your site map at Google WebMaster. (You will need a Google account to sign in, and may need to place a special verification meta tag in your index page to prove that you are the owner of the site).
- Bing accepts sitemaps at its Webmaster Tools sub-site.
By themselves, XML site maps do not guarantee higher ranking in search engines, or even that the search engine will use every piece of information presented in the site map. They can certainly help lead search engines to resources on your site that might otherwise be overlooked, and supply more contextual information about your site as a whole… and that is always a good thing.
Enjoy this piece? I invite you to follow me at twitter.com/dudleystorey to learn more.