How to Create and Submit a XML Sitemap

Building and submitting a sitemap is one of the best ways to ensure all of the valuable content on your site can be found by search engines. A sitemap is not the only way search engines can discover pages on your site but it is your "direct line" for telling Google what is important.


What is a Sitemap?

A sitemap is a file that provides search engines with a clear understanding of your website's content and structure. It functions as a roadmap, guiding search engine crawlers to efficiently discover, index, and understand your website's pages, videos, and other files.

Sitemap Types

There are various types of sitemaps, each catering to specific requirements:

XML Sitemaps 

The most prevalent type of sitemap, XML sitemaps, are used for standard web pages. They are XML files that list the URLs of your website's pages along with supplementary metadata such as the last modification date and priority.

RSS/Atom Sitemaps 

These sitemaps are specifically tailored for websites with frequently updated content, such as news or blog sites. They leverage RSS or Atom feeds to notify search engines about new or updated content.

Video Sitemaps

As the name implies, video sitemaps are designed to provide information about video content on your website. This includes details like video URLs, titles, descriptions, and other relevant metadata.

Image Sitemaps 

Similar to video sitemaps, image sitemaps function by informing search engines about the images on your website. They include details such as image URLs, captions, and other pertinent information.

News Sitemaps 

These specialized sitemaps are designed for news websites and provide information about news articles, including their publication dates, titles, and other relevant metadata.

Do You Need a Sitemap?

The short answer is, not really depending on the size of your site and how your site is built. You probably don’t need a sitemap if you have a small site (<100 URLs) and all of the URLs are linked internally. But if you have a rather large site that has thousands, maybe millions/billions, of URLs, then having a sitemap will benefit you greatly.

Benefits of XML Sitemaps

Enhanced Crawling and Indexing 

Sitemaps streamline the process for search engines like Google, Bing, and Yahoo to crawl and index your website's content. This ensures that your webpages are effectively incorporated into search engine results pages (SERPs).

Improved Visibility

A well-structured sitemap can potentially increase your website's visibility in search results by making it easier for search engines to discover and index your content. This can lead to a significant boost in organic traffic.

Faster Content Updates 

Sitemaps notify search engines about new or updated content on your website, enabling them to crawl and index these changes more promptly. This ensures that your website's search results are always current and up-to-date.

Clear Content Organization

Sitemaps offer a structured overview of your website's content, providing search engines with a comprehensive understanding of the hierarchy and relationships between different pages. This facilitates more effective crawling and indexing.

XML Sitemap Best Practices

Prioritize Key Pages: Search engines should see your most valuable content first.

Valid XML Structure: Follow the rules for clear communication with search engines.

Submit to Search Consoles: Make it easy for Google and Bing to find your sitemap.

Keep File Size Manageable: Break down large sites into multiple sitemaps for faster processing.

Inform Search Engines of Updates: Use the <lastmod> tag to signal fresh content.

How to Create an XML Sitemap

There are two ways to create an XML sitemap, the automatic way and building one from scratch. If you want to create an XML sitemap the automatic way, check out our Screaming Frog guide on how to create an XML sitemap.

Before creating a new sitemap, check if your site already has one!
Seer Resource: How to find your XML sitemap

To build an XML sitemap from scratch, please follow these steps:

Step 1: Gather all of your site’s URLs

There are a few ways to get a list of URLs for your website. The easiest way is to use a crawler like Screaming Frog to crawl your entire website to find all URLs. If you don’t have a copy of Screaming Frog, you can also find your URLs by:

  • Manually looking at your site and collecting all URLs
  • Perform a site search in Google to identify the URLs that Google has in its index
  • Look at Google Analytics landing page report to find URLs

The most important thing to keep in mind when gathering URLs for a sitemap is to determine if you want Google to index that specific page. For example, your homepage is most likely a page you want in the index but not your privacy policy or terms and conditions page.

Step 2: Code the URLs

Once you have a list of URLs that you want to include in your sitemap, it is time to code the URL in an XML format. In order to code the URLs in the proper format, you’ll need a text editor such as Sublime Text.

A) Start by opening a <urlset xmlns=""> tag

pasted image 0 9

B) Next, add your URL using the <url> and <loc> tags

pasted image 0 8

C) You can stop here if you like but there are other optional tags that you can use to add more detail to your sitemap. Optional tags are:

  1. <lastmod>: The date the page was last modified.
  2. <changefreq>: How often does the page change?
  3. <priority>: How important is this page compared to your other pages. Values for this range from 0.0 to 1.0 with 1.0 being the highest priority

pasted image 0 10

D) Close with a closing </url> and </urlset> tag

pasted image 0 5

How to submit your sitemap to through Google Search Console

Now that you have your XML sitemap created, it’s time to submit it to Google through Search Console. Here’s how you can do that in a few easy steps:

1. Sign into Google Search Console and click “Sitemaps” in the left sidebar

pasted image 0 6

2. Add the URL of your sitemap at the top of the page where it says “Add a new sitemap”

pasted image 0 7

3. Click submit and Google will crawl your newly created XML sitemap.

If you like this article, you should check out our newly updated Screaming Frog Guide that is packed full of tips and tricks to do almost anything.


Get more posts like this - delivered straight to your inbox:

Sign up for newsletter

We love helping marketers like you.

Sign up for our newsletter to receive updates and more:

Nick Haigler
Nick Haigler
Sr. Manager, SEO