What is Sitemap.xml and what’s its role in SEO?

Tiempo de lectura: 4 minutos

One of the many elements of an SEO strategy you can optimize is the sitemap.xml. The benefit of doing so is that it can improve the position of your web in any search engine’s ranking. Therefores, it’s essential to know its scope and what you should do to optimize it.

In this article, we are going to learn what this element is, along with a tutorial on how to create it and why sitemap XML is important for SEO.

👨‍💻   What is the Sitemap.xml, and what is it for?

The sitemap.xml definition, not to be confused with the HTML sitemap, is that it’s a file that, as can be seen in its extension, is in XML format. This document’s goal is to help Google understand which web pages are relevant and which ones they should look at.

In SEO it’s common to talk about Google’s bots or spiders using the sitemap.xml file as one of the main methods to find webpages for crawling and analyzing. Then, if Google considers the content appropriate, the web is included in its index.

It’s important to understand that the sitemap.xml should contain only the pages or URLs that we consider relevant for the business and our SEO strategy. Therefore it should include the webpages that we would like to have positioned and appearing in Google for certain searches.

On the other hand, those pages that do not contribute to SEO and your business purposes should not be included in the sitemap.xml file. Neither should the sections of your web that you don’t want Google to index. An example of this kind of web content is legal pages like:

  • Privacy policy
  • Terms and conditions
  • Cookies policy

Another example is the URL of private areas of the website, which are commonly only accessible by password.

Summing up, the main goal of your sitemap.xml should be facilitating Google’s job in prioritizing the most relevant content of your whole website.

Should all websites have a sitemap.xml?

The answer is no, not necessarily

Since Google has limited resources to crawl all the content online, optimizing the sitemap.xml file is especially important in SEO strategies for large websites with thousands of pages of content. In these cases prioritizing is important so Google gets a clear view of the website and can index it more precisely.

The XML sitemap helps your web when used well, but a poorly optimized file could hurt your web rankings so don’t neglect it

Accessing the sitemap file is easy as long as you know the address, which can be /sitemap.xml, or /sitemap_index.xml. Having one or another option depends on the CMS used at the website or the name granted to the file, especially when a plugin isn’t used to generate it.

🗺️   How to create a Sitemap?

There are different ways to configure a sitemap.xml, some are simpler and others can be quite complex. Luckily if you use a CMS like WordPress, in addition to a SEO plugin like Yoast SEO or Rank Math, you practically won’t have to do anything.

With one of these two plugins installed (or other ones not as popular as these two), the sitemap.xml is created automatically. But you can still take some things into account to optimize it.

Plugins with sitemap XML generators normally give as a result a sitemap with the extension /sitemap_index.xml so in your case, it should be like this: 


Entering this link you will find different sitemaps; for blog posts, web pages, and other types of content such as product or blog categories, tags, e-commerce products, etc.

If you want to become a SEO expert, this is your training 🖥️ Read more about it and startup your life!

SEO plugins remove and add content to the Sitemap guided by how we adjust them. So if we mark a page or web content as not to be indexed (or noindex), the plugin will remove it from the sitemap. And this is great since it allows us to decide and execute which content is to be indexed and which isn’t.  

Even when you publish new content on your site, such as a page or blog post, the sitemap gets automatically updated with the new URL, except if you mark it as noindex. And if you delete content from your web, then it gets removed from the sitemap.

In addition to using plugins, you can also create your sitemap.xml manually, although this process requires advanced knowledge and sometimes premium SEO tools. Some of the most commonly used for this task are Screaming Frog or XML-sitemaps.com (limited free version).

If you decide to generate the sitemap manually and use this kind of tool, consider that you will be forced to upload the sitemap.xml file manually to your website’s root file. 

And finally, in case you use other CMS like Prestashop or Shopify, then each case can be different, although typically there is a native sitemap o more advanced alternatives like addons or special modules for creating the sitemap.

Once it’s created, what’s next?

There are some very easy steps that you should do with your sitemap.xml file, once it’s created.

Firstly you should send it to Google through the Search Console tool. In this free tool, you can link your website with an option to send your sitemap.xml to Google for indexing. That way, Google will take your website sooner into account and you also get statistics about all the information within your sitemap.

To do so go to the left sidebar and select the “Sitemaps” option:

If your sitemap is yourdomain.com/sitemap_index.xml you will simply have to add it, excluding the domain (sitemap_index.xml), and click Submit.

adding sitemap image

Once this is done, Google will process the file and update it again from time to time, discovering new information such as new or removed pages.

Finally, although in most cases the SEO plugin takes care of it, you can also add the sitemaps full address onto the Robots.txt file.

image with name of the sitemap added

To learn more about this file we recommend you read Google’s article about them. 

The XML sitemap or sitemap.xml is a common and modest element in SEO but in many cases, it can be very important. Especially if your website is small, with a few dozen URLS for example, you should optimize it making sure it includes only relevant information and doesn’t include pages that are better nonindexed in Google.

And if you want to go even further, check out our Online Master in Digital Marketing to become a SEO expert