How to Make a sitemap.xml File

Why have an XML sitemap?

There are lots of good reasons to have a sitemap.xml file on your site. A sitemap.xml file:

  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 Google that you can't get otherwise.
  6. Gives you access to diagnostic tools provided by the search engine that you otherwise cannot reach.
  7. Sitemap.xml files used to be just for Google, but now Yahoo! uses sitemap.xml files, too. It looks like sitemap.xml files 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 a sitemap.xml file

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

Step one: Make your sitemap.xml file

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

If you'd rather have it get made automatically, try the Google sitemap generator (requires login) or GSiteCrawler. There are plenty of other options popping up all the time for how to make it easy to make a sitemap.xml file. Here is Google's list of free sitemap generation programs from third parties.

A simple Google sitemap.xml file 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 are 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.

How to submit the Sitemap.xml file

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.txt file for workability, and many more tools. Google adds new tools to their webmaster area quite often. Also, the documentation in the Google webmaster area is recommended reading.

How to submit a sitemap.xml file to Yahoo!

Go to the Yahoo free submit page while signed in to your Yahoo! ID. If you don't have one, create your Yahoo ID 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.xml file now. So, what's next?

Let the search engines know where your sitemap.xml file is

Search engines have standardly looked for a robots.txt file for the longest time. If you don't already have a robots.txt file, you need one. However, a recent addition to the standard procedure with robobts.txt files is the addition of a line indicating the sitemap.xml file location. They expect you to list your XML sitemap in your robots.txt 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 (put your sitemap.xml file's URL in there, not ours!)

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

Keep the relationship going

Check back regularly to find out how your sitemap.xml file 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.

Note: We offer a low-priced service of helping you to set up a sitemap.xml file and robots.txt file for your site - contact us for details.

Free Consultation

If you own or market a website, get a free 15-minute phone consultation from Words in a Row. (No one will twist your arm to buy anything.)

It's easy! Call 541-572-2569 now to set up your free appointment or contact us by email to set a time.

We always try to give you at least one thing you can do to improve your site in this free consultation.

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

Home Design SEO Marketing Writing Tools Books Clients Contact Email Lists

SEO by Words in a Row