developer creating xml sitemaps

Per Google, “a sitemap is a file where you provide information about the pages, videos, and other files on your site, and the relationships between them.” There are two primary types of sitemaps that this guide will cover today: XML and HTML. We will also share what brands need to know when creating XML sitemaps and HTML sitemaps.

What’s the difference between XML sitemaps & HTML sitemaps?

The biggest difference between XML sitemaps and HTML sitemaps is that XML sitemaps are created solely for search engines. Search engine spiders, like Googlebot, read XML sitemap files to crawl and index your site more efficiently. They typically live off the root of the domain at /sitemap.xml (or somewhere similar) and must be formatted as an XML file.

HTML sitemaps are created mostly for people, including those using screen readers or other assistive devices. They can also be helpful for search engines as the internal linking they provide can communicate how the website is structured and how pages are related to each other. HTML sitemaps are formatted via HTML (a regular website page) with links to the various sections and pages on your website. When it comes to SEO, HTML sitemaps can keep users on the site longer and help reduce bounce rates.

A website can (and often should) utilize both types of sitemaps since they are intended for different users.

What should we include in our XML sitemap?

Your XML sitemap (also sometimes referred to as a “Google sitemap” or simply a “sitemap”) should include all pages you want indexed. Typically, that means all 200-status code, self-canonicalized HTML pages, in addition to images, videos, and sometimes also PDFs.

Make sure any URL in your main navigation, category/collections pages, products, blog posts, informational pages, and the homepage are included in your XML sitemap so search engine spiders can easily navigate throughout your site and understand its most important pages.

What should we include in our HTML sitemap?

Your HTML sitemap should include links to all top-level pages on your site, meaning the homepage, all categories or collections pages, links to blog categories or topics, and links to your informational page sections.

While some sites opt to include links to every blog post, product, and/or informational page on their site, it’s not necessary. HTML sitemaps should help your users navigate to different sections of your site, not necessarily to each individual page.

Sites that choose to include links to every page aren’t doing something wrong, but typically, a user should be able to find individual pages via your site’s search bar and use the HTML sitemap to find a relevant section of information. However, if your site is small, it might make sense to include every page.

Sitemap tips & reminders

XML Sitemaps

  1. Some people choose to separate their XML sitemaps into multiple sitemaps based on website structure. This means a site might have an XML sitemap for products, one for categories or collections pages, one for blog content, and more. This is perfectly fine. Combining each of these into one larger XML sitemap is also fine.
  2. Each XML sitemap may include up to 50,000 URLs. If your site has more pages than this, you will need to set up multiple sitemaps.
  3. Be sure to include a link to each XML sitemap file in your robots.txt file.
  4. Some people choose to include priority levels in their XML sitemap to help explain the importance of their site’s pages. While Google no longer uses this tag, Bing and other search engines may. If you decide to include them, make sure they make sense hierarchically. For example, rank your homepage as 1.0. Rank collections or categories as 0.8. Rank products at 0.6, informational pages and/or blog posts as 0.4, and so on. Do not assign the value of “1” to every page on your site, or you may confuse Googlebot.
  5. If you choose to use the <lastmod> and/or <changefreq> fields in your XML sitemap, make sure they are regularly updated and that they make sense. <lastmod> is more important than <changefreq>, so if you find that the frequency at which your pages are updated does not align with what is in that field, you may want to consider removing it.
  6. Submit all XML sitemaps on your site to Google Search Console (GSC). This is especially important for new sites. Once it’s submitted and read by Google, you can find helpful information regarding pages that are or are not indexed via GSC.

Examples of XML Sitemaps

Here is an example of Apple’s XML sitemap files listed in their robots.txt file:

example of XML sitemap files listed in robots.txt file

This is an example of REI’s XML sitemap with <lastmod> dates included (but <changefreq> fields excluded):

example of XML sitemap with <lastmod> dates included (but <changefreq> fields excluded)

HTML Sitemaps

  1. One way to think about an HTML sitemap is as a site directory. This can be especially useful for large or complex sites with lots of different categories that may not all be easily found or linked to. Include each of your site’s main topics with links to each sub-topic in this directory.
  2. Link to your HTML sitemap in the footer of your website so it is accessible from every page.

Example of HTML Sitemaps

Here is an example of Apple.com’s HTML sitemap:

screenshot of apple's html sitemap

How to create an XML sitemap

XML sitemaps are typically auto-generated through a website’s CMS platform. There is often a setting to enable the creation of it from the active pages on your site.

If your platform lacks that functionality, you can use a tool like ScreamingFrog to crawl your site and export an XML sitemap file from the crawl. To create a xml sitemap, make sure you upload the file to your site once exported.

If you don’t have access to either of those, Google suggests one of these options from the Google Code Project*.

*Note, the Google Code Project has been deprecated and is no longer maintained, so we can’t guarantee the links in this file still work. However, they should provide a jumping off point for where to start if you’re looking for a different solution.

How to create an HTML sitemap

Some content management systems come with a native HTML sitemap function built into the platform. Others don’t and may require you to install a plugin, app, or extension to create an HTML sitemap.

If you don’t have access to any of those, you can build it manually, but we don’t recommend this option unless your site is very small (around 100 pages or less) because it will be time intensive to both create and maintain.

Regardless of the method you choose, make sure you update it regularly as sections or URLs on the site change. 

Final thoughts on XML and HTML sitemaps

While XML sitemaps help search engines efficiently crawl and index your site, HTML sitemaps improve navigation and user experience. Creating and maintaining both types of sitemaps is important so your website is accessible and easy to crawl and index. Do you have questions about your site’s XML or HTML sitemap or need help decoding Google Search Console’s indexing errors? Contact our SEO team!