How to use an XML sitemap

Why have an XML sitemap?

There are lots of good reasons to have a sitemap file. It:

  1. Makes sure every page you want listed in the search engines in known about by the search engine.
  2. Lets you tell all the search engines about new pages on your own schedule.
  3. Makes it clear to the search engine which pages you care about and which you don't care about and how often you update those pages.
  4. Gives you a closer understanding of how the search engine "sees" your site.
  5. Allows you to get detailed error reports and crawl information from the search engine you otherwise can't get.
  6. Gives you access to diagnostic tools provided by the search engine that you otherwise cannot reach.
  7. It used to just be for Google but now Yahoo! does it, too. It looks like it will be the broadly accepted submission format of the future.

Sounds good, right? OK. Let's get started explaining what you need to do.

How to set up the sitemap

Many people create the sitemap file on their website and think they're done. That is the first step of many. Having a sitemap can mean an actual relationship with the search engine and requires some time to set up - but it's well worth it when you're done.

Step one: Make your sitemap file

Start by creating a sitemap file in XML. You can use Google's instructions to get started or you can use Sitemaps.org's instructions.

If you'd rather have it get made automatically, try the Google sitemap generator or GSiteCrawler. There are plenty of other options popping up all the time for how to make it easy.

A simple Google sitemap looks something like this:

<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
<url>
<loc>http://www.wordsinarow.com/xml-sitemaps.html</loc>
<lastmod>2006-12-12</lastmod>
<changefreq>weekly</changefreq>
<priority>1.00</priority>
</url>
</urlset>

Or like this for a general sitemap for anyone, not just Google:

<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>http://www.wordsinarow.com/xml-sitemaps.html</loc>
<lastmod>2006-12-12</lastmod>
<changefreq>weekly</changefreq>
<priority>1.00</priority>
</url>
</urlset>

Of course, the information inside those tags will be different for your site. Details on what's allowed for each of those tags is covered in the protocols (listed above). But if you copy that and put your own information in, making a new <url></url> tag for each separate URL to submit, you should be fine.

You probably don't need to include the links to every image and file on your site. Every URL in the sitemap is something you are submitting for broad public consumption.

Once you've got your sitemap built, look it over for glaring problems - especially if you automated the process.

Carefully review the "priority" you have assigned each URL in the sitemap. Your index page probably should be your top priority URL, followed by the URLs that best lay out and describe your products and services, followed by keyword-heavy URLs that give info, followed by everything else in whatever order you consider them important. Ranking something a 1.00 makes it the most important. Don't rank everything the same or you're wasting this tag. Use a max of two decimal places (0.75 for instance) when setting importance. As for the last modified tags, don't try to "fool" the search engines by saying that you update every day when you don't. They know better and - like a marriage - it's not good for the relationship to start out by lying.

Then validate the file. You can validate xml code at XML Dom. Once your XML checks out, the sitemap is ready to upload to your site. Put it at the root (same folder as your primary index page) and call it sitemap.xml to make things easier for yourself later on.

Submit the Sitemap

Just making the file and putting it there doesn't actually do much of anything. You have to go through the steps to submit it to the search engine to profit from all that work.

How to submit an XML sitemap to Google

Start by creating a Google Webmaster account. Like any Google services, it requires having a Google account, which - if you don't have one- can be set up here first. Make sure you create the account with an email address you will be using from your webmaster duties - it doesn't have to be a gmail account.

After you create a webmaster account, follow the instructions to add your site. Then add a sitemap, giving the complete URL to the sitemap to Google.

After you've added your site, you'll be asked to "verify" the site. You can either add a piece of code to the home page <head> tag or you can add a file with the name Google gives you to your site in the same folder as the sitemap. Google provides pretty clear instructions as you go. Once you've made the changes to your site (proving that you really are in control of the site), you'll be verified.

Once you're verified, and have a sitemap that you've told Google about, you'll be waiting for data.

Usually right away, the sitemap gets crawled. Often, even before that happens, you can access detailed crawl information for your website and errors Google has encountered. You can use that information to improve the site, remove dead links, check your robots file for workability, and many more tools. Google adds new tools to the webmaster area every day. Also, the documentation in the webmaster area is recommended reading.

How to submit the XML sitemap to Yahoo!

Go to the Yahoo free submit page while signed in to your Yahoo! ID. If you don't have one, create one here.

On the Yahoo Free submit page, skip the "submit a website or webpage" section - you need the "Submit Site Feed" section - Yahoo calls all URL lists "Site Feeds" and accepts more than just the XML sitemap format.

After submitting, you'll be taken to your control area, where you can then "authenticate" your site through a process of placing a verification file that Yahoo tells you to make (this one must be named the specified name and contain a specified random string of characters within it). Similar to Google, you upload the file to the same folder as the sitemap, and then "authenticate" your site.

You can also access the Yahoo Site Explorer from here.


OK. I've got a sitemap. So, what's next?

Let the search engines know where your sitemap file is

Search engines have standardly looked for a robots file for the longest time. If you don't already have one, you need one. However, a recent addition to the standard procedure with robobts files is the addition of a line indicating the sitemap file location. They expect you to list your XML sitemap in your robots file when you have one. So, somewhere in robots.txt, add a line that reads something like this:

Sitemap: http://www.wordsinarow.com/sitemap.xml

This line allows all four of the major search engines to find the sitemap file, even the search engines you can't actually register the sitemap with.

Keep the relationship going

Check back regularly to find out how your sitemap is doing, whether the search engine is having any trouble, to get specifics on all kinds of info that you otherwise cannot get and to access tools useful to you as the webmaster. New tools get added regularly at this point.

But, in exchange for all the neat toys they're giving you to play with for free, the search engine needs you to keep your sitemap up to date. If you change your site, update your sitemap. Keep the "last modified" information up to date, and any other details you use in the file. You usually can resubmit the sitemap if you want the site newly crawled.

Even if you don't intend to do a lot of updating of your site, or have any real use for all the information you get from the webmaster areas at search engines, at some point you may find this invaluable. We recommend that every single webmaster take the time to create his user account at both Yahoo and Google, and keep up the files he creates for the search engines.

This new XML sitemaps standard has already nearly replaced the previously complicated website submission procedure. We hope everyone else follows Google's lead, as Yahoo! did.

Return to Top of Page.

Back to Search Engine Registration Information.

Advice on how to submit an XML sitemap to Google and Yahoo search engines

website design
Home Design SEO Marketing Writing Tools Books Clients Contact