An XML sitemap is a list of all URLs of a web site's pages in XML format. XML stands for Extensible Markup Language and refers to a markup for websites that’s similar to HTML.
You can upload an XML sitemap of your website to Google Search Console in order to provide Google with an overview of all URLs that exist on your website. XML sitemaps were particularly relevant in the past when you had to submit your site to Google for crawling and indexing. Nowadays, this is no longer mandatory if you want your site’s pages to be included in Google’s index. However, submitting a sitemap can still have a beneficial effect on search engine optimization (see section "Importance for SEO").
In contrast to HTML sitemaps, an XML sitemap is usually not visible for visitors of your website and serves mainly as information for search engines.
Contents and example
An XML sitemap contains all URLs of a website, information about character encoding and, if required, additional metadata such as the date when specific pages were last updated, the frequency of changes or the importance (priority) of an URL.
The following is a simple example of an XML sitemap with only one listed URL (http://www.example.com/page1.html):
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://www.example.com/page1.html</loc> </url> </urlset>
Creating and using an XML sitemap
Many content management systems (e.g. Wordpress) and shop systems have a function for creating a dynamic sitemap, i.e. a sitemap that is updated regularly. In addition, there are helpful online tools, such as xml-sitemaps.com, which allow you to automatically create an XML sitemap for your website. If you have in-depth technical skills you can also build an XML sitemap manually.
Screenshot of xml-sitemaps.com
You have to upload the finished XML sitemap to the root directory of your domain, where it can be retrieved by search engine crawlers. You can easily check whether you saved the file in the correct directory by entering your website URL with the addition "/sitemap.xml" (e.g. http://www.example.com/sitemap.xml) into the search bar of your browser. To make sure that crawlers can retrieve the file, you can also indicate the location of your sitemap in the robots.txt file. Alternatively, you can upload your sitemap directly to Google Search Console.
In addition to a general XML sitemap, you can also create specific sitemaps for images, videos, or news content.
Importance of XML sitemaps for SEO
By uploading an XML sitemap to Google Search Console, Google is informed about all pages available on your website. This can encourage indexing of weakly linked pages or inaccessible content, such as images, and helps Google optimize its crawling.
Especially for new sites that have few or no backlinks, an XML sitemap can help search engines find all pages of the site and index them faster. In addition, the indexing of dynamic content is facilitated by a sitemap. Even with very large websites, a sitemap can help to ensure that newly added content does not get lost in the high mass of URLs. In addition, you can add meta information to your sitemap to inform Google about the date when certain pages were last updated and about the frequency of updates.
However, submitting an XML sitemap does not guarantee that all pages of your website will be included in Google’s index, nor does it improve the ranking of those pages. Instead, sitemaps merely increase the likelihood that weakly linked content will be found by Google.
Guidelines for sitemaps
If you want to create an XML sitemap for your website, you have to follow some guidelines regarding the structure of this file. First of all, your XML sitemap has to comply with Google’s sitemap protocol 0.9. In addition, it can contain a maximum of 50,000 URLs and may not be larger than 50 megabytes. If this size is exceeded, you have to split your sitemap into several files. If necessary, you can also create a sitemap index file in which all sitemaps are listed and which is then submitted to Google.
You should also make sure that your sitemap always contains the correct version of a URL. This applies, for example, to websites that can be reached both with and without "www." in the URL. In this case, you should not use the URL that redirects to the actual website. In addition, URLs containing session IDs should not be included in sitemaps.
Finally, your XML sitemap has to be encoded in UTF-8 format. You can find the complete XML scheme for sitemaps at sitemaps.org.