Building the Ultimate XML Sitemap


mapAn XML Sitemap is a sitemap created for search engines. The XML Sitemap is a listing of all the URLs on your site that you want search engines to crawl and index. The Sitemap also provides information on when pages get updated and how important they are. Search engines do not guarantee they will fully abide by the sitemap, but search engines do use XML Sitemaps for assistance in crawling the web.

Many webmasters and SEOs have reported improved traffic simply from submitting the Sitemap. In addition, the Sitemap can greatly assist in diagnosing indexation shortcomings. Submitting a proper, up-to-date XML sitemap, therefore, is an SEO best practice.

Building a Sitemap can be very easy or quite complex. The return on investment with Sitemaps varies tremendously from case to case; indeed many people can waste time getting bogged down in Sitemap technicalities if it is unwarranted. The amount time you put into Sitemaps should depend on your needs. This guide focuses on thinking critically about how utilize Sitemaps as an SEO tool to address your specific needs of your website and SEO campaigns.

There are 10 steps to building the Ultimate XML Sitemap:
1. Understand XML Sitemaps
2. Identify what types of Sitemaps you need
3. Pick Sitemap Generation Method
4. Figure out Sitemap content and structure
5. Build Sitemap
6. Check and validate Sitemap
7. Submit Sitemap
8. Check & Monitor Sitemap
9. Learn and Act
10. Rinse and Repeat Steps 8 and 9

Step 1: Understand XML Sitemaps

While you won’t need to hand-code XMl Sitemaps, I really recommend you get a basic understanding of how search engines use them, the protocol for Sitemaps, size limits, and the tags used in Sitemaps. Get it straight from the horse’s mouth by checking out Google’s section on Sitemaps.

Step 2: Identify what types of Sitemaps you need

In addition to the standard XML Sitemap, there is a Sitemap index and four more specialized sitemaps (the code search sitemap is now basically useless since Google Code Search has been deprecated this year.) If you want to improve traffic to videos, images, your mobile site, or news articles, use specialized Sitemaps (Sitemap extensions).

The 6 Types of Sitemaps:

  • Video
  • Images
  • Mobile
  • News
  • Sitemap Index if you have multiple sitemaps
  • Standard Sitemap

Step 3: Pick Sitemap generation method

There’s a few ways to build Sitemaps and tons of tools to help do so.

Needs analysis:
First, perform some needs analysis to figure out the best way for you to go about building the Sitemap by asking the following questions:

  • What CMS do you have? (There are many generators specifically made for certain CMSs, like WordPress.)
  • Approximately how many pages will you be submitting? (Unless your Site is really tiny, you’ll want a Sitemap generator. Also, most free generators will only crawl up to a certain number of pages)
  • Do you suspect you are having notable issues with the search engines properly crawling and indexing your site?
  • Do you want a simple solution so you can set and forget? OR…,
  • Do you want to really dig in and optimize indexation?

At this point, you should have a good idea how much effort you should put into your Sitemaps.

Find a Sitemap generator:
Unless you have a very small site and/or a desire to hand code the Sitemap, you’re probably going to use a Sitemap generator tool to build the Sitemap file. The generator will look out the pages in your site and list them on the Sitemap, according to XML Sitemap protocol and how you configure the generator.

There are basically two types of generators — those that crawl your site (like Googlebot does), and those that look at your site from the back-end. I find that CMS-specific back-end based generators usually make life easier. (That said, I do highly recommend running a crawler on your site from time to time to see all existing URLs, broken links, http status codes, and such.)

Here is a list of Sitemap generators. You may also want to perform a separate search for generators specifically for your CMS.

Sitemap generator selection criteria: Pick a generator that:

  • will generate the types of Sitemaps you need.
  • fits your needs identified in needs analysis.
  • updates dynamically. Updating static Sitemaps is usually an unnecessary and undesirable chore.
  • set the sitemap tags for individual pages and groups of pages
  • break up sitemaps into pieces however you want
  • *Bonus: find orphan pages (pages that do not have any pages linking to them)

Step 4: Figure out the Sitemap content and structure

Next, we need to figure out which URLs are going into the Sitemap, and, if your site is large, which URLs go into which Sitemaps.

Sitemap content:
To decide which URLs to include in your Sitemap, you need to figure which pages you want the search engines to crawl and index. Remember, we’re only going to list one URL for each page. We also will leave out pages that should be private.

Sitemap structure:
You may need multiple Sitemaps files if:

  • You want special sitemaps for specialized content (images, videos, etc…)
  • You suspect certain sections of your site are at risk for indexation shortcomings and you’ll want to analyze those sections
  • You have a large site (each Sitemap file can only be up to 50,000 URLs or 50MB)

When deciding how to structure Sitemap files of the same type, section the Sitemaps in terms of what is most helpful in diagnosing indexation issues. Ask yourself 2 questions:

  • What parts of your site are not getting indexed that should be?
  • What pages are not getting indexed frequently enough?

Here is a great article on structuring Sitemaps to assist in diagnosing indexation issues.

Step 5: Build Sitemap

You can either let the generator go and do its thing or you can tweak settings to generate the Sitemap that shows the engines exactly how you want your site crawled.

Things to tweak in your Sitemap:

  • Sitemap tags
  • Sitemaps segmentation — divvy up individual Sitemaps by type and by a structure that will best help you diagnose indexation shortcomings. Give them descriptive names as well.
  • Exclude URLs that should NOT be indexed
    • Exclude URLS disallowed in robots.txt (good time to make sure you’re disallowing the right urls)
    • Exclude URLs disallowed via meta noindex tags
    • Exclude duplicate URLS
    • Exclude private pages

Uploading Sitemap:
After you run the sitemap, you will upload it to your site, ideally at the root directory like so: Technically, you don’t have to place it at the root, but there will be some limitations.

XML Sitemap and Source Code

**Congratulations! If you’ve completed Step 5, you’ve now built your XML Sitemap. However, the next steps will ensure you get the most out of your Sitemap. Let’s proceed…

Step 6: Check and validate Sitemap

Now, it’s time to make sure the Sitemap follows protocol and says what you want it to say.

There are a few tools to validate that your Sitemap follows protocol and will be fully useable by search engines. Since we should be submitting the Sitemaps to Google Webmaster Tools anyways, I like to use this. If you don’t use Google Webmaster Tools, now is the time to start; GWT may be second only to Google Analytics in terms of being the best free tool for webmasters. To test your sitemap, simply go into Google Webmaster Tools, and click the “Sitemaps” link under “Optimization” in the left navigation section of your Add Test Sitemapsite’s dashboard. Then click the big red button and test away. If you’re feeling warm and fuzzy inside, then I presume Google can read your Sitemap.

Manual check:
But wait! Just because your Sitemap follows protocol doesn’t mean it looks the way you want it to. Best to check the following…

  • Does it list the pages you want indexed?
  • Does it exclude pages you don’t want indexed? (like duplicate urls or private pages)
  • Do the tags describe the URLs like they should?

Step 7: Submit Sitemap

BWT Submit Sitemap

Once the Sitemap is all checked out, it’s time to make sure the engines know about it. I recommend submitting the Sitemap directly to Google and to Bing (which powers Yahoo). I recommend doing this through Google and Bing Webmaster Tools, because you should use those tools to analyze your Sitemaps anyways. (In Bing Webmaster Tools, go to your website dashboard and click the “Sitemaps” link in the “Configure My Site” dropdown in the left nav.)

Also, be sure to list your Sitemap in your robots.txt file to ensure it gets found by all search engines.

Step 8: Check & Monitor Sitemap

I highly dissuade you from setting and forgetting when it comes to your Sitemaps. There’s a lot of information you can get in Bing and Google Webmaster Tools (especially the latter). In fact, in many cases it is the diagnostic assistance which is the biggest benefit of Sitemaps.

Be sure to check on pages indexed versus URLs submitted. It’s rare that the number of pages indexed matches what you submitted, but something is amiss if there is a big difference in the numbers.

Also pay attention to Sitemap errors and warnings. The less errors and warnings you have, the more likely the search engines will listen well to your Sitemap. Sitemap errors and warnings may reveal problems with robots.txt, Meta robots tags, duplicate content , or other issues.

If you have a Sitemap that 100% accurately represents how you want your site crawled, then you can gain a ton of insight by comparing Sitemap stats to other data points. Consider cross referencing the following:

  • GWT Index Status ‘site:’ search:  Enter in Bing and Google site:www.yourwebsite/subdirectory to find what is indexed. This may not be 100% accurate but it can help the investigative process.
  • Analytics: See which pages received search engine visits in Google Analytics.
  • GWT Index Status:  Compare the stats on crawling and indexation, and pay attention to spikes in number of pages crawled and indexed.
  • BWT Site Activity: Compare the stats on crawling and indexation, and pay attention to spikes in number of pages crawled and indexed.

Step 9: Learn and Act

A perfect Sitemap can be your best tool in diagnosing indexation shortcomings. If you’re having problems diagnosing indexation issues, consider tweaking your Sitemap to perfection.

The goal is to get the right pages indexed, and new content on those pages indexed as soon as possible. Use the information from your Sitemap analysis to diagnosis issues with site structure, duplicate content, and internal linking to help you reach this goal.

Step 10: Rinse and Repeat Steps 8 and 9

Definitely keep checking in on those Sitemaps every once in a while to see if you’re having any addressable indexation issues. Be sure to check in after major updates to your site or any major traffic pattern changes. Remember, your XML Sitemap is a great tool, so use it.

Rinse and Repeat

Reid Bandremer is a former LunaMetrician and contributor to our blog.

  • i have created xml sitemap generator.

  • I want to create a large site map is larger than 500 link

  • As I understand from your article, I need to create a separate sitemap for the images in my website. In that case, shall I open a new folder in the root directory of the website and how should it be named to distinguish it from the pages sitemap?

    • Reid Bandremer

      Hi Raffi,

      You can add image info to the standard Sitemap, or you can add a separate Sitemap just for images, as detailed at If you create an additional image Sitemap, you can name it whatever you’d like, as long as it is at the root directory, and you inform the search engines of the names of your Sitemaps, either in the robots.txt file, a Sitemap index, or by submitting it to Bing/Google Webmaster tools (i recommend all 3 methods for multiple Sitemaps). Protocol on Sitemaps, including location, here:

  • Can you recommend a dynamic sitemap creator that works with sites?

    • Reid Bandremer


      I’ve never used an dynamic Sitemap generator so I suppose I cannot recommend. However, this one was located on Google’s XMl Sitemap list and there is another one that may be what you’re looking for.

      Perhaps you can test those out.

  • Also does the order of the pages on the sitemap have any relevance? I was sort of wondering if I should have the important pages at the top. My head says it makes no difference.

    • Reid Bandremer

      Good question, Will. The answer appears to be it “likely makes no difference” as seen at What I think is that the order of the URLs never matters except in one possible condition – where the spider hits the crawl budget and must stop crawling your Site before it is complete. That scenario might occur for sites with index bloat and URLs at the end may be crawled less frequently – note that this is just my educated guess.

      Also, note that you can indicate priority of a page with the tag (

  • alex

    Oh, really i want to submit sitemap, this article is helpful to understand what really i need to do. But I have some query how can submit mobile version website sitemap.

  • Muhammad Wajid

    i need sitemap with unlimited links
    is there any let me know

  • Muhammad Wajid

    how can we edit a site map is there any tool
    how to create txt site map

  • Thank you for this link I been looking for a sitemap generator that will pick up all of the pages for my website
    I run my wordpress website of a database and it generates extensions like and for some reason I can’t figure out the sitemap generators don’t pick up these pages, maybe someone can explain why?

    • Reid Bandremer

      I’m not sure why the Sitemap doesn’t catch those URLs with the VenuesID parameter. However, even if they did, and the search engine crawlers crawled those pages, they would probably not index them because the target of rel=canonical for those pages is So, first make sure the pages are indexable, then make sure they are in the Sitemaps. Maybe those issues are related…

      Good luck Antoine

  • Hey thanks for the detailed and insightful article, however I have a asp coded website,, and I am not sure how to build a sitemap for it. I can use online generator however I don’t know how to submit it on the website. I am customed to use wordpress earlier.

  • Rajeev Sharma

    I have created mobile version of sitemap.xml and submitted to google webmaster tool but showing

    item – web – 11 submitted – indexed 9

    item – mobile – 11 submitted –

    My question is why not indexed for mobile?

    • Rajeev,
      Hmmm, I’m not sure; I haven’t worked with mobile Sitemaps much lately*, but here’s some thoughts:

      -*Lately, I work with responsive sites mostly and you don’t need a mobile Sitemap for responsive.

      – Check out Note some of the requirements there; including “Any URLs that serve only non-mobile web content will be ignored by the Google crawling mechanisms.” I’m not sure that this will display a visible error.

      – If you have separate URLs for mobile or unique content for mobile (aka dynamic serving) , check to see what’s indexed. Do some Googling to see what shows up – I’d do the searches on your phone incognito. You may also need to use site:search. If you have unique mobile URLs, you can also check Google Analytics to see if the mobile landing pages have gotten organic traffic. (I’m not sure how GWT Sitemaps treats mobile Sitemaps for dynamic serving content).

      *The 3 types of mobile setups (responsive, dynamic, seperate URLs) are described here:

  • Arta

    I use this and it saves lots of my time

  • Garenne Bigby

    Have you tried the DYNO Mapper Sitemap Generator ( ). It creates visual sitemaps integrated with Google Analytics, Content Inventory/Audit, Keyword Rankings, and Accessibility Testing.

  • Thank you for letting readers understand sitemap. Since each component is well-explained, I am pretty sure that anyone who’s in need of good and detailed information about sitemap can find what they’re looking for in this article.

    I just got some questions in mind. Is it okay to put the same URL in different sitemap category? What could be the possible effect for this?

    Thanks in advance.

Contact Us.

Follow Us



We'll get back to you
in ONE business day.
Our Locations
THE FOUNDRY [map] LunaMetrics

24 S. 18th Street
Suite 100

Pittsburgh, PA 15203


4115 N. Ravenswood
Suite 101
Chicago, IL 60613


2100 Manchester Rd.
Building C, Suite 1750
Wheaton, IL 60187