How to create an XML Sitemap?

daily ocr article main image
Date: 2023-12-21 | Category: XML Sitemap
Author: Herbert Stonerock

Creating a XML Sitemap

A sitemap is an essential tool for website owners and developers to inform search engines about the pages that are available for crawling on their site. An XML sitemap, in particular, is a specific format designed for search engines. By creating and submitting an XML sitemap, you can improve the visibility of your website on search engine results pages (SERPs) and help search engines understand the structure of your site. In this article, we'll walk you through the process of creating an XML sitemap and following sitemap protocols.

An XML sitemap is a file that lists all the URLs of your website and provides additional metadata about each URL, such as when it was last updated, how often it changes, and its importance in relation to other URLs on the site.


<?xml version="1.0" encoding="UTF-8"?>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

   <url>

      <loc>https://dailyocr.com/blog/article/how-to-create-an-xml-sitemap-30</loc>

      <lastmod>2023-01-01</lastmod>

      <changefreq>monthly</changefreq>

      <priority>0.8</priority>

   </url>

   <url>

      <loc>https://dailyocr.com/blog/article/what-is-a-xml-sitemap-29</loc>

      <lastmod>2023-01-01</lastmod>

      <changefreq>monthly</changefreq>

      <priority>0.8</priority>

   </url>

</urlset> 

Explaining the sitemap parts

According to www.sitemaps.org , the sitemap needs to follow the protocol by using the <urlset> and </urlset> tags to mark the beginning and closing of the sitemap, in the opening tag the protocol version needs to be specifed (see line 2 in the example above) . Withing these tags the <url> and </url> will mark the beginning and closing of each URL entry in the URL list. The and like all other tags will mark a beginning and a closing, in these tags the actual URL will be stored. Only URLs from the same domain are allowed and all other tags are optional.

Below is a list with all tags used in a standard sitemap along with a short description:

  1. <urlset> ,</urlset> - The urlset tags mark the beginning and the end of the URL list, within these tags your URL list will be stored.
  2. <url> ,</url> - Within these two tags a single URL will be stored along with some other relevant data
  3. <loc> ,</loc> - The loc tags will hold the actual URL
  4. <lastmod> ,</lastmod> - The date when the last updates occured
  5. <changefreq> ,</changefreq> - An estimated frequency of updating the URL content.
  6. <priority> ,</priority> - The priority of each URL to be indexed by a crawler.

Other sitemap protocols to be followed

  1. URL limit - There is a 50000 URLs limit for each sitemap file, if you have more than 50000 URL you can create another sitemap file and a sitemap index file.
  2. File size - Should not be larger 52,428,800 bytes, another file must be created even if the 50000 URL limit is not reached.
  3. Valid URLs - Ensure that all URLs in your sitemap are valid and accessible.

A simpler way to create XML Sitemaps

Another way to create your sitemap is to look for online services the provide an XML Sitemap generator. These generators are very easy to use, you just pass your full website address as input and depending on the generator maybe you can also add a custom date, priority value and changefreq value. The software will scan your website for all accessible URLs and will create the XML Sitemap, after the process is finished you should be able to download the file.

Finding a XML Sitemap Generator is not hard at all, you just need to make a Google search with the search term "xml sitemap generator" and you will get pages and pages of Google results with sitemap generators and articles that lead you to one.

That being said, we also offer a free to use XML Sitemap Generator that will scan your website and will create a sitemap file following all the protocols described above and if your website has more than 50000 pages you will get multiple files just ass the protocol recommends.By clicking here you will be directed to our free to use sitemap generator tool.

Validating the Sitemap file

Validating the sitemap is basically making sure the file created is following the protocol to the letter. If you are brave enough you can verify the file manually by reading it and making sure that it has the correct structure, since this would be a very time consuming task almost all webmasters and developers have a program that does this for them. Verifying your sitemaps structure is very simple and straight forward, find a sitemap verifying tool and simply use you sitemaps URL as input and the tools should let you know if there are any issue.

Naturally, we also provide a tool that verifies the structure of a sitemap and if it is following the protocol. Just click on this link and input you sitemaps URL to the tool and it will let you know if the sitemap is ok or not.

Another type of validation is making sure that all URLs in the generated sitemap are accessible by web crawlers, by accessible we mean that the HTTP response code should not be a code that represents an error, forbidden or not found, in other words anything above the 400 HTTP response code. In order to make sure that this issues does not occur and to save time you can easily find an online tool that does just that. We got you covered on this one too, our Broken Links Checker will scan your sitemap and will test every URL that it finds, then it will create a report containing all broken and good URLs. Not only this tool, but every tool like this one will greatly improve your time spent searching for broken links.

Submitting the Sitemap to search engines

Submitting your sitemap to search engines helps ensure broader visibility for your website, catering to various user demographics and regions. Regularly monitoring these platforms will also help you stay updated on any indexing or crawling issues.

Remember, while it's beneficial to submit your sitemap to these search engines, the actual traffic you receive will largely depend on your target audience and the regions you aim to serve.

Below is a list of search engines to which you can submit your xml sitemap:

  1. Google Search Console - Essential for most websites due to Google's dominant position in global search.
  2. Bing Webmaster Tools - Managed by Microsoft, Bing is significant, especially in the U.S. and some other regions.
  3. DuckDuckGo - Known for its privacy-centric approach, this search engine has been gaining popularity.
  4. Ask.com -While its relevance has diminished, it still serves a segment of users, especially in the U.S.
Image by upklyak on Freepik
Article Contents
Subscribe to our blog
Share this article

Leave a comment


Comments (0)


No comments yet. Be the first to tell us what you think!