Create an XML Sitemap for Your Website

create_xml_sitemap

What is a Sitemap?

Before we jump straight into creating a sitemap let’s just briefly review what a sitemap is. Sitemaps are basically a map of your site. It defines the URL structure and helps search engines know what is contained in your site so search engines can find those pages.

If you have a well designed site, most search engine crawlers will be able to find all of the URLs contained within. The Sitemap will allow you to add additional information to assist the crawlers.

Ways to Create an .XML Sitemap

There are basically two ways for creating a Sitemap.

  • Manually
  • Sitemap Generator

If you have a small site, 1 – 20 pages or so, you could probably get away with creating the Sitemap manually.

Manually Create a Sitemap

  • Open your code editor and save the document as sitemap.xml or mymap.xml or whatever you want to call your Sitemap. Typically it is called sitemap.xml
  • Insert this code at the very top of your page:
    <?xml version=”1.0″ encoding=”UTF-8″?>
  • Place this on the next line:
    <urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″>

Now it is time to insert the information about your site. On the next few lines you will put the following information.

<url>
  <loc>http://www.yoursite.com/about.htm</loc>
  <lastmod>2009-01-27</lastmod>
  <changefreq>monthly</changefreq><priority>0.8</priority>
</url>

Make sure to put the date in the correct format which is YYYY-MM-DD

The lastmod, changefreq, and priority are all optional fields.

Lastmod: The last date the page was modified.

Changefreq: How often does the page change? Options for input are:

always, hourly, daily, weekly, monthly, yearly and never.

Priority: What is the priority of the page? The scale is from 0.0 to 1.0 where 1.0 is the highest priority.

Note: If you make all of the pages the same priority, it will offset what you are trying to achieve. Set your highest priority page or pages to 1.0, your next at 0.9 and so on.

You will repeat the above steps for all of the pages on your site you feel need to be included in the sitemap. A completed example would look like:

<?xml version=”1.0″ encoding=”utf-8″?>
<urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″>
<url>
  <loc>http://www.yoursite.com/ </loc>
  <lastmod>2009-01-27</lastmod>
  <changefreq>daily</changefreq>
  <priority>0.9</priority>
</url>
<url>
  <loc>http://www.yoursite.com/about.htm </loc>
  <lastmod>2009-01-27</lastmod>
  <changefreq>monthly</changefreq>
  <priority>0.1</priority>
</url>
<url>
  <loc>http://www.yoursite.com/contact.htm</loc>
  <lastmod>2009-01-27</lastmod>
  <changefreq>monthly</changefreq>
  <priority>0.1</priority>
</url>
</urlset>

Using a Sitemap Generator to create your .XML Sitemap

Probably the easiest method for creating sitemaps, especially if you have a large site, is to use a Sitemap Generator. There are several Sitemap generators you can download for free or have installed on your server. Here is a list of Sitemap generator tools that Google notes on their site. Note they are third party and not Google’s Sitemap generator. They are relatively easy to use and will provide instructions for creating your map.

What to Do Now the Sitemap is Created?

Upload the Sitemap to your root directory. Example: http://www.yoursite.com/sitemap.xml. Let search engines know where your Sitemap is. Here is how to submit sitemap to Google, submit sitemap to bing, submit sitemap to yahoo, and submit sitemap to Ask

2 Comments


  1. Geneva Genao
    Jan 13, 2010

    Keep up the good work


  2. Abdelghani Achahoud
    Feb 06, 2010

    thanks for this article about how to create your xml sitemap

Leave a Reply

Subscribe

Our Categories