XML Sitemap

What Is an XML Sitemap

An XML (Extensible Markup Language) sitemap is a file that contains directions to all of the web pages on a website. An XML sitemap is, quite literally, a map of a website’s hierarchy that Google’s crawlers can use to navigate the site more efficiently.

Is an XML Sitemap Mandatory?

A website doesn’t need an XML sitemap for its pages to be found and indexed by crawlers. They will still go through all of the pages they can find, with or without a sitemap present. However, crawlers can sometimes miss pages that are harder to find (such as orphaned pages),  in which case a sitemap can point them in the right direction.

Indexation

A common misconception about XML sitemaps is that they help with indexation. In reality, the requirements for a page to be indexed remain the same, regardless of whether there’s a sitemap or not:

  1. Google crawlers find the page.
  2. They decide that the page is worth indexing.

Having a sitemap won’t make up for lackluster content and won’t shift the odds in your favor. All that a sitemap does is tell Google which pages you consider to be high-quality search landing pages. It’s still up to them to agree or disagree with your assumption.

An XML sitemap is not a way of making Google index a page it otherwise wouldn’t. It’s just a hint at what you consider to be priority pages and a path for crawlers to follow. It will not affect indexation.

Types of Sitemaps

Types of sitemaps are specific to the types of content you can find on a website. Google can recognize several types of sitemap files:

  • HTML
  • Mobile
  • Video
  • Image
  • News.

XML Sitemap Example

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

<urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9” xmlns:xhtml=”http:www.w3.org/1999/xhtml”>

   <url>

      <loc>https://www.website.com</loc>

      <lastmod>2021-09-09</lastmod>

      <changefreq>weekly</changefreq>

      <priority>0.7</priority>

      <xhtml:link rel=”alternate” hreflang=”en” href=”https://www.website.com”/>

      <xhtml:link rel=”alternate” hreflang=”de” href=”https://www.website.com/de”/>

   </url>

XML Sitemap Glossary

The sitemap from our example contains only one URL so far. Adding more would require additional <url> tags and an understanding of sitemap tags in general.

The only mandatory tag is <loc>. It defines the URL of a web page you’re adding to the sitemap.

<lastmod>, <changefreq>, and <priority> are all optional tags that aren’t necessary for the sitemap to work.

<lastmod> is an optional tag that shows the date when the page was last modified. It’s formatted as YYYY-MM-DD.

<changefreq> shows how frequently the web page is updated, and the values available are:

  • always
  • hourly
  • daily
  • weekly
  • monthly
  • yearly
  • never.

Setting the <changefreq> optional tag won’t make the crawlers revisit the web page in specified intervals. Again, it’s just providing hints to search engines.

<priority> shows how relevant a page is to you. The value ranges from 0.0 to 1.0, which crawlers use as a clue when ranking pages within a single website. The default value of a <priority> optional tag is 0.5.

The priority of a web page is relative to all the other pages on your website, hence, there’s no point in setting the priority of every page to 1.0.

Learn On-page SEO

Title Tag Errors

Title tags are the first things that users notice when they see your website in the SERP, which makes them crucial if you want to capture customers’...

read more

Learn Technical SEO

XML Sitemap Errors

An XML sitemap serves as a comprehensive file that lists all the webpages on your site that you want search engines like Google to crawl and index....

read more

Learn off-page SEO