What Is an XML Sitemap and How Do I Make One?

Looking at a map.

An XML sitemap is a file that webmasters create and put on their site to tell search engines like Google and Bing about the pages, images, and videos that are on the site. This content list works like a map, helping ensure more thorough crawling and indexing.

The XML sitemap is created using XML (Extensible Markup Language), a type of markup language used on the web in which tags share information.

Not only do XML sitemaps tell the search engines all the URLs that you want indexed and crawled, but they also provide other information, such as how frequently you update the pages.

An XML sitemap differs from an HTML sitemap in that the XML sitemap is just for search engines. On the other hand, an HTML sitemap is a webpage on your site that contains links to help visitors navigate to the important pages on your site.

Now that you have definitions in hand, let’s talk about:

XML Sitemaps: An SEO Best Practice with Benefits

For SEO purposes, you must build an XML sitemap and keep it up to date to help ensure that search engines index and crawl all the important pages on your site.

While some view an XML sitemap as “nice to have,” it’s actually an SEO best practice for every site to have at least one — even though Google says that sites under 500 pages might not need it.

Sure, search engines should be able to find all the pages by following links on the site, but the reality is that many sites don’t follow proper linking architecture. So, it can be hard for search engines to discover the content.

Benefits of XML sitemaps include:

  • They improve the crawl rate and indexation on a site.
  • They can help you spot problems (for Google, check Search Console).
  • They provide other useful information to search engines about your site.
  • They alert search engines to new pages and hopefully get them indexed sooner than if you waited for search engines to find them.

Now that we’ve gone over some benefits, it’s worth noting what XML sitemaps cannot do:

  • An XML sitemap does not guarantee that a search engine will index or crawl all pages, nor will it pass any link popularity or help with subject theming.
  • An XML sitemap will not impact your rankings. However having a higher number of pages indexed in the search engines may increase your chances of ranking.
  • An XML sitemap should not be relied upon as a way to fix crawling issues. If there is an indexation problem, also look at other factors like the architecture of the site or the quality of the content and its links rather than relying on an XML sitemap alone.

Special XML Sitemaps to Know

Other than the standard XML sitemap, it’s good to know about key sitemaps specific to content such as news, images, and video. Here, we’ll primarily go over Google sitemaps. You can learn more about Bing sitemaps here.

News XML Sitemaps

If you are a publisher of news-related content and don’t have a news sitemap, you may not be getting the visibility you want. For articles that have been published in the past two days, a news sitemap contains URLs for them. Create news sitemaps in addition to your generic XML sitemaps. For more, learn how to create a news sitemap.

Video XML Sitemaps

Video sitemaps can help Google find and understand your video content by telling it exactly where and what the video content is on your site. Video content includes webpages that embed videos, URLs to video players, or the URLs of raw video content. If Google cannot discover the video content at the URLs provided, it will ignore them. Note that while Google recommends using video sitemaps and schema.org’s VideoObject to mark up videos, it also supports mRSS. You can also view Bing’s guidelines on video sitemaps here.

Image XML Sitemaps

Image sitemaps help Google discover images on your site — especially those reached via JavaScript. You can suggest the most important images on your page that you want included in Google.

How to Create an XML Sitemap

You could create a sitemap manually, but using a sitemap generator makes the job easier. And to help you, there are many good third-party tools for creating XML sitemaps. One is Microsoft Bing’s free server-side Bing XML Sitemap Plugin, which can automatically generate two types of XML sitemaps that any search engine can read:

  • Comprehensive sitemap, which includes all files (except any you disallow in your robots.txt file)
  • Recently updated sitemap, which includes URLs of changed files only (useful for your own tracking or for prioritizing the pages that search engines should crawl)

Here’s a useful video from Google on creating an XML sitemap:

We also cover how to create sitemaps (both XML and HTML versions) in our SEO Guide.

For Large Websites

XML sitemaps are especially useful for large sites to make sure all the URLs are discoverable by search engines.

Large websites may need to break their list of URLs into many XML sitemaps. This ensures that the number of page URLs per sitemap doesn’t exceed the limit.

XML sitemaps can contain up to 50,000 page URLs.

You can have separate XML files by media type if you have original videos, news, images, etc., that you want to be indexed. So, for example, if you have videos on your site, create a specialized video XML sitemap to help make sure the search engines find your video files.

As a bonus, if you break down your XML sitemaps into smaller sitemap files, maybe by site sections, it allows you to watch your indexation performance for each section of your site and identify where indexation issues exist.

You can then create a sitemap index file that lists all the sitemap files on your site. To optimize sitemap files, you can also compress the file using gzip.

XML Sitemap Tips

The required XML tags are: <urlset>, <url>, and <loc>. The tags <urlset> and <url> are for formatting the XML, and <loc> is for identifying the URL.

Optional metadata tags are:

  • <lastmod> – last modified date
  • <changefreq> – how often the page changes (such as hourly, daily, monthly, never)
  • <priority> – how important the page is from 0 (the lowest) to 1 (the highest)

Site owners aren’t required to use the optional tags, but the engines may consult them when deciding how often they should recrawl pages. Google states that it does not use the <priority> or <changefreq> tags at all. While Google may consider <lastmod>, it does not base decisions on this tag.

If you use these tags, keep them accurate to help the search engines better crawl your site. Pages that you are optimizing should be set to a higher priority. If you have archived pages that you haven’t updated in years, set to a low priority with a <changefreq> of “never.”

Upload to the Site

Once you have created the sitemap file, upload it to the root of your website (for example: https://www.your-domain-name.com/sitemap.xml). Now it’s time to let the search engines know about it using your robots.txt file.

A robots.txt file is simply a text file saved at the root of your website that gives instructions to visiting search engine spiders.

Your robots.txt file should look like this, with a sitemap directive line for each of your different XML sitemaps:

User-agent: *
Disallow: /tmp/
Disallow: /filename.html
Sitemap: http://website.com/my-sitemap1.xml
Sitemap: http://website.com/my-sitemap2.xml

If you have multiple sitemaps, or if your CMS generates files with some unique names, then all you have to do is mention them by name in the robots.txt file, one per line. Or if you have created a sitemap index file, then you can specify just the index file location in the robots.txt and list all your separate sitemap files in the sitemap index.

That’s it! Now you can let the search engines do the rest.

Submitting a Sitemap

Some people prefer to submit the sitemaps manually. This is primarily due to timing. A submission is known to start the indexing instead of waiting for the search engine to give you a turn.

Another reason to submit a new sitemap to Google is to check it for errors. Google tries to continue parsing a sitemap file even if it has minor errors. However, if the XML is badly formed, then it could cause Google to ignore all entries after the badly formed entry (like a missing “>” or “</url>” tag). The Sitemaps report in Search Console will tell you if any problems were encountered, such as:

Has errors: The sitemap could be parsed but has one or more errors; any URLs that could be parsed from the sitemap will be queued for crawling.

You can proactively submit your XML sitemap(s) to Google and Bing as follows:

  • Google: Log in to your Google Search Console account and go to Sitemaps.
  • Bing: Log in to Bing Webmaster Tools. Then see the Sitemap widget on the dashboard or go to the Sitemaps feature.

Sitemaps report in Google Search Console.
Google Search Console’s Sitemaps tool lets you submit a sitemap and view history.

XML Sitemap Case Study

After diagnosing that a client with a large website had only 20% of pages indexed, we implemented several tactics to help. We resubmitted their standard XML sitemap and fixed a large number of errors coming up on the client’s Search Console account.

We also submitted specialized XML sitemaps and implemented canonical tags throughout the entire site, as it had a large amount of duplicate content.

Indexation results jumped from 24% to 68%! And this percentage keeps growing, resulting in significant improvements in organic search traffic.

Final Thoughts

The goal of XML sitemaps is to help search engines crawl efficiently and thoroughly. You facilitate this by creating a sitemap and using the appropriate tags so the engines can understand how to best crawl your site.

As a final note: Be sure to keep your XML sitemaps up to date. If you add or remove pages, make sure your sitemap reflects that. You should also check Google Search Console frequently to ensure that Google is not finding any errors in your sitemap.

You can find more information about the sitemaps protocol at sitemaps.org.

If you need help with your website’s organic search performance, contact us for a free quote for SEO services.

FAQ: How do XML sitemaps enhance search engine optimization, and what are the benefits they offer?

XML Sitemaps have emerged as a fundamental tool for bolstering search engine optimization efforts. These structured documents serve as a roadmap for search engine crawlers, directing them to all the essential pages of your website. This proactive approach ensures that search engines can efficiently discover and index your content, thereby improving your website’s overall visibility in search results.

One notable benefit of XML Sitemaps is their ability to prioritize content. You can guide search engine bots toward your most critical pages by assigning priority levels to different pages. This becomes particularly advantageous when dealing with large websites or those with intricate structures, preventing vital pages from being overlooked during crawling.

Furthermore, XML Sitemaps facilitate the inclusion of additional metadata about each page. Search engines rely on this information to make informed indexing decisions that ensure your latest and relevant content gets priority. Metadata provides this tool, helping search engines determine when a page was last changed and its update frequency compared to others on your site. With such metadata in hand, search engines are better equipped to prioritize indexing decisions accordingly and give it the focus it needs.

Incorporating XML Sitemaps also leads to quicker indexation of new or updated content. When you publish fresh material or change existing pages, the sitemap signals to search engines, prompting them to crawl and index the changes sooner. This feature is invaluable for time-sensitive content, such as news articles or limited-time promotions.

In a competitive online landscape, user experience is paramount. XML Sitemaps indirectly improve user experience by ensuring visitors can easily find your content through search engines. When your website ranks higher in search results due to effective indexing, it attracts more organic traffic, which in turn can lead to higher engagement, conversions, and business success.

XML Sitemaps are an essential asset in modern SEO strategies. Their ability to guide search engine crawlers, prioritize content, and expedite indexation significantly impacts a website’s visibility and user engagement. By integrating XML Sitemaps into your SEO practices, you harness a powerful tool that enhances your online presence and sets the stage for sustainable growth.

Step-by-Step Procedure: Enhancing SEO with XML Sitemaps

  1. Understand XML Sitemaps – Get acquainted with XML Sitemaps, as they serve as navigational tools for crawlers.
  2. Generate XML Sitemaps using either a CMS plugin or an XML Sitemap Generator Tool.
  3. Include Essential Pages: Ensure that your XML Sitemap includes all crucial pages of your website, including main content, category pages, and important internal links.
  4. Set Priority and Frequency: Assign priority levels and update frequencies to pages within the XML Sitemap to guide search engine crawlers toward important content.
  5. Add Last Modification Dates: Incorporate the last modification dates for each page in the XML Sitemap to indicate when the content was last updated.
  6. Submit Sitemaps to Major Search Engines. Submit your XML sitemaps via major search engines such as Google and Bing’s respective webmaster tools to submit them as searchable indices.
  7. Update your Sitemap Regularly: Keep an XML sitemap updated whenever new content or any alterations are added or changes to your website.
  8. Monitor Crawl Errors: Periodically check for crawl errors and issues related to your XML Sitemap in the webmaster tools.
  9. Optimize Site Structure: Ensure your website’s structure is organized and user-friendly, which indirectly benefits XML Sitemap functionality.
  10. Prioritize User Experience: Focus on providing valuable and relevant content to enhance user experience, which contributes to improved search rankings.
  11. Create High-Quality Content: Craft high-quality, informative content that naturally incorporates relevant keywords to attract organic traffic.
  12. Utilize Internal Linking: Implement effective internal linking strategies to guide users and search engine crawlers through your website.
  13. Monitor Analytics: Regularly monitor website analytics to track the impact of XML Sitemaps on search engine visibility, traffic, and engagement.
  14. Stay Updated on SEO Trends: Stay informed about evolving SEO practices and algorithm changes to adapt your XML Sitemap strategy accordingly.
  15. Optimize for Mobile: Ensure your website is mobile-responsive, as mobile-friendliness is crucial in search engine rankings.
  16. Promote Social Sharing: Encourage social sharing of your content, as social signals indirectly influence search engine rankings.
  17. Manage Duplicate Content: Address duplicate content issues, as they can affect your website’s search engine performance.
  18. Optimize Images: Compress and optimize images to improve website loading speed, positively impacting user experience and SEO.
  19. Secure Your Website: Implement security measures such as SSL certificates to establish a secure browsing environment, which can enhance search rankings.
  20. Regularly Audit and Update: Regularly audits your XML Sitemaps, content, and SEO strategies to adapt to changing search engine algorithms and user behavior.

Bruce Clay is founder and president of Bruce Clay Inc., a global digital marketing firm providing search engine optimization, pay-per-click, social media marketing, SEO-friendly web architecture, and SEO tools and education. Connect with him on LinkedIn or through the BruceClay.com website.

See Bruce's author page for links to connect on social media.

Comments (5)
Still on the hunt for actionable tips and insights? Each of these recent SEO posts is better than the last!
Bruce Clay on November 19, 2024
The Always Up-to-Date SEO Checklist
Bruce Clay on November 13, 2024
How AI Can Help With Local SEO: 4 Ways
Bruce Clay on November 11, 2024
How To Increase Website Speed for User Engagement

5 Replies to “What Is an XML Sitemap and How Do I Make One?”

Having XML sitemaps allows search engines to crawl and index a website sufficiently, and allowing all search engines to be notified of the site map by inserting it into the robots.txt file.

Its always good to be knowledgeable about these important things while doing SEO thank you for sharing this knowledge

Great content about sitemaps. I actually use the free XML generator tool to create sitemaps for websites. It is a very easy method and does not require any coding work.

Explained step by step with proper image. i got the idea from this post and very useful to me. thanks for sharing the article and keep tough with us

A sitemap is important for web development. It’s also essential for improving User Experience (UX) and getting to the top of the search engine rankings.

Follow these 5 steps to create effective sitemap for your website:
1) Plan out your primary pages
2) Keep it simple
3) Sort out secondary pages
4) Establish a URL structure
5) Leave room for content expansion

LEAVE A REPLY

Your email address will not be published. Required fields are marked *

Serving North America based in the Los Angeles Metropolitan Area
Bruce Clay, Inc. | PO Box 1338 | Moorpark CA, 93020
Voice: 1-805-517-1900 | Toll Free: 1-866-517-1900 | Fax: 1-805-517-1919