Definition: An XML sitemap (or sitemap.xml) is a text file with a list in XML format that contains all the subpages of a website as links. It is used to tell search engine robots which subpages are available on a website and which they should crawl. They therefore help with indexing by search engines. A webmaster can usually remove individual pages from the sitemap if search engines should not crawl them. Several sitemaps can also be created, e.g. if the website has several language variants. One or more XML sitemaps can be uploaded to the Search Console (formerly Webmaster Tools) for Google.
Search engines can crawl all subpages if they only have one link to the website. However, the XML sitemap makes their work much easier, especially as there is no disruptive crawl depth.
Content
Why do I need an XML sitemap?
How is an XML sitemap structured?
How do I create an XML Sitemap?
How can I transfer an XML sitemap to Google?
Tips for different content types
Watch the video
Why do I need an XML sitemap?
XML sitemaps are important from an SEO perspective in order to be able to provide search engines with the current website architecture at all times. If you have a deep architecture with 5+ levels, the search engine bot may not crawl all pages. The so-called crawl budget is then used up. A page that has not been crawled will not be indexed. The sitemap contains all the URLs of your website that should be included in the index. This means that the bot only has one URL from which it can reach all other URLs. This wastes considerably less crawl budget.
How is an XML sitemap structured?
In order for an XML sitemap to be accepted by search engines, you must observe a few requirements when creating it: The markup language, which you specify with
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
all URLs of the page in the elements , the character code, e.g. UTF-8 and other metadata such as the priority of a URL (0-1), the date of the last update and the update frequency. However, it is not mandatory to specify a frequency. You can also leave this point blank. It is important that you do not upload a sitemap with more than 10MB in uncompressed form to Google. A sitemap may also not contain more than 50,000 URLs. If your web project contains more than 50,000 URLs, split the URLs into several sitemaps and create a sitemap index file. You can find more information on this directly at Google.
An example of a sitemap structure would be (according to Wikipedia):
<?xml version="1.0" encoding="UTF-8"?> http://example.com/ --> URL of the subpage 2006-11-18 --> Date of last modification daily --> update frequency 0.8 --> Priority of the subpage
How do I create an XML sitemap?
Common CMS (Content Management Systems) such as Drupal, WordPress etc. can create XML sitemaps for you via script, plugin or generator. With Drupal, for example, there is the Drupal XML sitemap module. If you want to create the sitemap yourself, you can use the online tool https://www.xml-sitemaps.com/, for example. However, the free version of the tool only allows 500 URLs. If you have a blog and use other functions such as tags and dynamically created overview pages, you will quickly exceed this number. This makes the sitemap obsolete. However, if your website only contains a few subpages, you can create your XML sitemap with just a few settings.
Another free alternative (unfortunately only 500 URLs) is the SEO tool Screaming Frog, which offers numerous features as well as the option of creating a sitemap from the raw URLs.
After a few steps you will receive an XML sitemap:
Our recommendation is to find a way to create sitemaps free of charge in your CMS. The Drupal XML Sitemap module does this task for you if you use Drupal. The big advantage: you can have sitemaps recreated automatically as soon as something has changed in your website architecture and the module automatically transfers the sitemap to all common search engines.
How can I submit an XML sitemap to Google?
You can do this manually: As soon as you have created an XML sitemap, you can verify your site with your Google account (mandatory) (via the Search Console). Once this has been done successfully, you can upload your sitemap there under "Crawling" --> "Sitemaps" --> "Add/Test Sitemap".
If your sitemap has changed, you can and should upload a new version so that Google is always informed about the current status of your site. In the robots.txt file, you also tell the search engines where they can find the sitemap.xml.
Tips for different content types
If you publish several different types of content on your site, such as films, images or news, you can generate and upload a separate sitemap for each type. For news or other content that changes frequently, you can use a separate sitemap with a different update frequency. For images and videos, Google has already written articles to help you generate such special sitemaps. Images can contain information such as title and location. Videos, on the other hand, can contain much more data such as description or duration. These special sitemaps are used for indexing if you want your images to appear in the image search and your videos to appear as search results on Google.
Further references:
https://de.wikipedia.org/wiki/Sitemaps-Protokoll
https://www.sitemaps.org/de/protocol.html
The following video tutorial provides an introduction to XML, the language in which XML sitemaps and other formats are formulated: