Last Updated: November 25, 2019
What It Is
An XML Sitemap lets you share data about the pages on your website with search engines. By doing so, search engines gain a deeper understanding of which pages exist on your website that they could possibly include in the search results. XML sitemaps become increasingly important for larger websites where it is more likely search engines will be unable to crawl to every page on your website without a comprehensive list of all pages—that comprehensive list is the XML sitemap.
There are also specific XML sitemap formats for news, images, and videos. These can be especially helpful if your website relies heavily on that type of content. For example, if you regularly share videos on your website, having a video XML sitemap can make it easier for search engines to index those videos.
Reading an XML Sitemap
Here is an example entry from an XML sitemap. You’ll see several statements that look something like this within your website’s XML sitemap.
<url> <loc>https://www.site.com</loc> <lastmod>2021-01-29</lastmod> <changefreq>monthly</changefreq> <priority>1.0</priority> </url>
Everything in between the <url> and </url> tags is the information about one particular page on the website. The only required element is the URL to the page. To specify that, you state the link to the page inside the <loc> and </loc> tags. Those <loc> tags are nested inside the <url> tags. In this case, the URL indicates the home page of site.com.
All the other data within the same <url> tags relate to that page. In this example, we have the optional fields indicating the date the page was last modified (inside <lastmod>), a rough guide to how frequently the page changes (inside <changefreq>), and what priority you give this page (inside <priority>. While Bing’s developer notes seem to suggest they use these fields, it is worth noting that per Google’s developer specifications:
“Google ignores <priority> and <changefreq> values, so don’t bother adding them.”
If you want to list images or videos contained on this page in the XML sitemap, you can do so within the <url> tags. For example, here is the XML sitemap entry for Elementive’s about page listing the URLs for Andrea’s and my headshot images that are on this page:
<url> <loc>https://www.elementive.com/about-elementive/</loc> <image:image> <image:loc>https://www.elementive.com/data/uploads/Matthew-Edgar.jpg</image:loc> <image:title>Matthew Edgar</image:title> </image:image> <image:image> <image:loc>https://www.elementive.com/data/uploads/Andrea-Streff.jpg</image:loc> <image:title>Andrea Streff</image:title> </image:image> </url>
Selecting URLs For the XML Sitemap
When building your XML sitemap, the biggest mistake made is including pages you don’t want Google to find or pages Google simply shouldn’t find. For example, XML sitemaps that include broken URLs, URLs containing low-quality content, duplicate content, or URLs that are blocked (either in the robots.txt file or via a meta tag) will return errors and won’t do much to help your SEO performance. You want to regularly prune your XML sitemap file to check for and remove these pages.
Creating an XML Sitemap
Creating an XML sitemap is relatively straightforward and the protocol is fairly simple if you need to create an XML sitemap manually. There are also XML generation tools that can automatically create your sitemap. As well, many plugins exist that allow you to create XML sitemaps dynamically, including the Yoast SEO plugin for WordPress.
Submit XML Sitemap In Google Search Console
After creating the XML sitemap, you want to tell Google and Bing about your new sitemap. The easiest way is to submit your XML sitemap directly to Google and Bing via Google Search Console and Bing Webmaster Tools.
In the Google Search Console sidebar menu, go to the “Index” section and then click on “Sitemaps”.
On the Sitemaps page, you will see a form to Add a new sitemap. Enter the URL to your XML sitemap, then click “Submit.” Following this, Google will begin reviewing your XML sitemap.
You can check back to this same page later to see if Google has detected any errors with your XML sitemap. On the main list of XML sitemaps submitted, you’ll see when the sitemap was submitted, when Google last read the sitemap, if Google was successful in reading the XML sitemap and how many URLs were discovered on the sitemap file.
You can click on any of these XML sitemaps to view more details, including any details about errors that exist within this XML sitemap file.
From the details page, you can also click to “See Index Coverage”. This will show you the coverage report specifically for URLs contained in this XML sitemap file. On the coverage report, you can see any URLs listed on this XML sitemap with an error or a warning. This coverage report will also show you any URLs listed on the XML sitemap file that have been excluded for other reasons, such as duplicate content. If your XML sitemap for error URLs, low-quality pages, duplicate pages, or similar issues and remove those from the XML sitemap (and potentially, consider removing those pages from your website too).
As well, you can see how many pages Google discovered on the XML sitemap are valid pages, which indicates the page is eligible to appear in organic search results. If there are a lot of pages on your XML sitemap that is Google isn’t considering a valid page. Those pages will not be included in Google’s index and this is an indication you might have submitted pages in the XML sitemap you shouldn’t have.
Submitting the XML Sitemap In Bing Webmaster Tools
In Bing Webmaster Tools, navigate to Configure My Site, then click on Sitemaps.
After arriving here, enter in your XML sitemap URL, then click submit. Bing will then crawl through your XML sitemap. You can check back to this same page later to see if Bing has detected any errors with your XML sitemap.
List XML Sitemap on Robots.txt
Another way is to list the XML sitemap on your robots.txt file. This is especially helpful when your XML sitemap is not available at the standard “domain.com/sitemap.xml” URL or when you are unable to submit the sitemap to Google Search Console or Bing Webmaster Tools. For example, here is the XML sitemap directive on our robots.txt file:
- Sitemap Protocol
- XML sitemap generator
- Image sitemap
- Video sitemap
- Misunderstood Aspects of XML Sitemaps
Technical SEO Services
Want help with your website’s XML sitemap or improving your website’s other technical SEO factors? Contact me today.