Creating An SEO-Friendly XML Sitemap For Faster Indexing

December 6, 2023 | Technical SEO

SEO has become increasingly important today. Everyone is making a significant investment to rank high in the SERPs and sustain it. 

But what if your pages and blog posts don’t get indexed? Or the crawler discovers them quite later as per its own sweet will?

Your website will not get any traffic for the time being, despite having all other things on point.

Sometimes it can take up to 6 months to rank on Google SERPs. And a few more months to rank higher.

To fast forward this process, you can create an XML sitemap for your website.

You might think that it takes time to create an SEO sitemap, which is not entirely true. There are ways of creating sitemaps in minutes, and this article will tell you about them.

But before we jump in, let’s brush up on the basics.

What Is A Sitemap?


A sitemap is a file containing information about the pages, videos, and other files on your site and the relationships between them. Search engines like Google read this file to crawl your site more efficiently.

In simple words, it is a blueprint of your site. It helps search engines find, crawl, and index all your website’s content. Also, it specifies the importance of each page on your site. 

There are two major types of sitemaps:

  1. HTML Sitemaps 
  2. XML Sitemaps 

Both sitemaps are better known for their differences and role in website designing. To help you understand, we are going to discuss their differences and functionalities in detail.

XML Sitemap Vs HTML Sitemap: Differences

XML Vs HTML sitemap

In simple language, an XML sitemap is the one that showcases all the pages of your website to the Google crawlers, with the sole aim of letting them index your website properly. 

Also, XML sitemaps tell crawlers the relationships between various URLs on the site.

Moreover, a proper XML sitemap helps put your webpages in the spot without wasting any time. With an XML sitemap, you can remain assured that your web content will get the deserved SERP rankings.

Coming to the HTML sitemaps, they mostly resemble a menu on your website to help users find the page they are looking for.

They list all the important links on your site in a hierarchy and enhance the user experience.

HTML sitemaps are not much in use today because most modern websites have easy navigation. In fact, not having one for your site is perfectly fine.

What most websites use today are XML sitemaps. They are created particularly for crawlers.

And this is what we are going to discuss today: All about XML sitemaps. So, buckle up!

Why Do Websites Need An XML Sitemap?

Search engines, including Google, discover new content by crawling the web. And they do it regularly to organize and index information available on the internet.

When the search bots visit a page, they scan through its content. They follow all the internal and external links to discover more pages.

If any detected link is not present in Google’s database, the crawlers parse its content and index it. 

In case crawlers find indexed pages with updated content, they replace the old content with the most recent one.

But, Google might not always be able to discover new links on your site in this way. Or even if it does, it will take a long time.

That’s why you need an XML sitemap.

XML Sitemap Sample Code Structure

It is well known that XML sitemaps are designed for search engines and crawlers, not human beings. This is the main reason why XML sitemap code looks quite intimidating.

Below we have included an XML sitemap example to help you understand the various parts of the XML SEO sitemap.

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

<urlset xmlns=”″>










Confused? We know how intimidating this structure can look like. That’s why, we are going to break it up for you.

XML Statement

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

XML statement or declaration clearly states to the crawlers that this is an XML file containing the site maps of a website. Additionally, it also discloses the version and character encoding that has been used for the  XML sitemap creation. 

In the above sitemap example, you can clearly see that the XML version used is 1.0 and the encoding is that of UTF-8.

URL Folder

<urlset xmlns=”″>

As the name states, a URL folder contains all the URLs of your website. This section of the XML sitemap example states the crawlers about the various web pages that are present for indexing along with the protocol standard that has been used, which in this case is 0.90.

URL Tags





You can clearly see this section in the above sitemap example. It states the parental tags that you must use while issuing each individual URL. Additionally, you must provide the location of each URL as well, in the <loc> tag. Remember, that each of the URLs must be absolute and not canonicalized.

Apart from that, there are some other URL tags as well that you can see in the entire XML sitemap sample code structure. 

  1. The <lastmod> tag in the sitemap sample states the last time when the XML file was modified. In the above mentioned sitemap example, “2019-08-21T16:12:20+03:00” showcases the exact date and time when the XML file was modified.
  2. The <priority> tag in a sitemap sample states the priority of the URLs that are included in the sitemap. If you have several web pages, then you need to set the priority tag in the code to let crawlers understand that these URLs are of utmost importance and should be indexed first. The priority range is from 0.0 to 1.0.
  3. The <changefreq> tag in a sitemap sample states how likely a particular page is supposed to change, i.e. the frequency of change of a URL. It helps Google bots understand how often they need to recrawl these URLs so as to provide updated information.

How To Implement An XML Sitemap?

how to implement XML sitemap

While manual XML sitemap creation is possible, it is tedious and time-consuming.

As human beings make errors, you will have to make changes several times to create the perfect XML SEO sitemap.

But, we wouldn’t recommend you to design one for your website manually, as there are simpler, easier and accurate ways of creating sitemaps. 

And you can do it in less than 60 seconds! (It’s faster too.)

If you are ready to get started, we will follow a 4 step process on how to implement an XML sitemap quickly.

Step 1: Create XML Sitemap

There are two ways to create XML sitemap for your site quickly. You can choose either of the two as per your requirements.

Use Yoast Plugin to Create XML Sitemap (For WordPress Sites)

Some CMS’ have an in-built feature of an XML sitemap generator for your site. 

But, the case is not the same when you have a WordPress site in hand.

You need to use the Yoast plugin to create XML sitemap for WordPress sites. It is a popular SEO tool and makes XML sitemap creation very easy. 

But before disclosing the steps, you must ensure:

  1. You’re using a WordPress site.
  2. You’ve installed the Yoast SEO plugin.
  3. You’ve connected your site to Google Search Console.

If you’ve checked on these points, let’s begin.

Login to your WordPress Admin account and turn on Yoast’s advanced settings. If settings are off, Yoast will not build an SEO sitemap.

  1. Click on the ‘Y‘ icon with the title SEO in the left sidebar.
  2. Click the ‘Dashboard‘ option.
  3. In the Dashboard, click on ‘Features’. 
  4. When the menu opens, look for ‘XML sitemaps‘ and switch it on.
  5. Click ‘Save Changes‘ by scrolling down to the bottom.

Yoast will now generate a solid and well-structured XML sitemap for your WordPress site. You should now see your sitemap at either:


With that, you’ve successfully created an XML sitemap for your WordPress site. 

But, WordPress powers just 40% of websites on the internet. Web admins use other CMSs and custom-build sites too.

Note: When you build a site using Wix, Squarespace, HubSpot, or Shopify, it automatically generates an XML sitemap for your site. You don’t need the Yoast plugin, and your SEO sitemap is already on point!

Use Sitemap Generator Tools to Create XML Sitemap (For Custom Websites)

Here’s case two: websites that don’t use a CMS.

You can create an XML sitemap for custom websites with the help of a sitemap generator. It is a tool that automates creating sitemaps and saves you from coding it manually.

The free XML and HTML sitemap generators are not very reliable for websites with many pages. And for the ones that have frequent updates. 

If you have a site with more than 50,000 URLs or regular content changes, you must use the paid sitemap generators. 

Using the paid tools, you can create an HTML or XML sitemap. Other than that, you can use extra features like creating sitemaps for images, videos, news, RSS feeds, etc.

The key benefits of using a sitemap generator include:

  1. Fast and easy XML sitemap creation
  2. Detection and reporting of broken links
  3. Automatic submission to search engines
  4. Compatibility with all types of websites
  5. Sitemap updation as per need

To generate a sitemap for your site, you can use popular sitemap tools such as Screaming Frog, XML-Sitemaps, Inspyder, Slickplan, etc. 

Important: If you have AMP pages implemented on your site, you don’t need to build a sitemap for it.

So now you know how to create XML sitemap for WordPress and custom websites. Your next step should be testing the sitemap you’ve just created. 

Step 2: Test the XML Sitemap Using Google Search Console

There’s a feature in Google Search Console that will help you debug your sitemap.

  1. Login to Google Webmaster Tools and click on ‘Site Configuration’.
  2. From there, click on ‘Sitemaps‘. 
  3. On the top right, you’ll find a button titled ‘Add/Test Sitemap‘. Click on it.
  4. Enter the sitemap URL and click on ‘Test Sitemap’. 

And Google will begin scanning your sitemap for errors. When the test is complete, Google will display the test results. 

Make sure to click on ‘Close sitemap test‘ when you finish. 

If there are errors, you can correct them before adding the sitemap file to your site. And if it’s error-free, you are good to go to the next step.

Step 3: Add the XML Sitemap to Your Site

After creating and testing your sitemap, the next step is to add it to your site. 

You need to upload the XML sitemap to your site’s root folder, which is a 3-step process:

  1. Log in to the control panel of your current web host.
  2. Find the public_html directory. This directory contains other vital pages of your website, such as index.php.
  3. Once you locate the public_html directory, copy and paste the XML sitemap in it.

And once you’ve done that, congratulations! You’ve added a sitemap.

A few additional steps can speed up the discovery of sitemaps by search crawlers:

  1. Add your sitemap URL to the robots.txt file.
  2. Submit your sitemap to various search engines.

Now I’m going to show you how you can upload the XML sitemap to Google.

Step 4: Submit the XML Sitemap to Google Search Console

The last and final step is here.

It’s time to make your sitemap valuable by submitting it to Google. To start, you need to know the location of your XML sitemap.

In most cases, your sitemap will be at

Once you find the location of your sitemap, copy the URL. 

Then, go to Google Search Console. 

  1. Select your website, and your dashboard will open.
  2. Go to the left side panel and click on ‘Sitemaps’.
  3. You’ll find a box that reads ‘Add a new sitemap‘. 
  4. Enter the sitemap URL (that you copied) and click on ‘Submit’. 
  5. Before you submit, check that the URL ends in .xml since this is an XML file. 

These 4 steps sum up the implementation of XML sitemaps. 

Once the sitemap is successfully submitted, you will see the list of submitted sitemaps below it.

The list of submitted sitemaps also shows the status of the sitemap and the number of URLs it contains.

Generating Error-free XML Sitemaps

If there are errors in your sitemap, your submission will be unsuccessful. 

That’s why you must conduct thorough Site Audits to ensure that the XML sitemap is free of errors.

Before submitting your sitemap to Google, you need to check for the issues through RankWatch’s Site Auditor.

RankWatch site audit dashboard

After entering the domain URL, the tool will analyze your website and present before the set of issues based on their priority level.

RankWatch site audit issues section

Based on the priority mentioned in the tool, you need to attend to them and ensure that they are resolved. Only after you have removed those errors, you can submit the XML file to Google.

Apart from that, make sure to remove low quality pages from the sitemap as well. 

Why? That’s because these pages eat up your crawl budget, divide the link juice, and bring down your site check-up score as well.

When Do We Create Multiple Sitemaps?

Multiple sitemaps

Multiple sitemaps help you organize the pages and content of your website. 

They ensure the search bots don’t miss out on your site’s URLs and drop them from the index.

Your site can have multiple sitemaps when:

  1. You want to create different sitemaps for images, videos, and podcasts on your site. There will be a dedicated sitemap for each content format. 
  2. You want to create a sitemap for your site’s pages and another one for blog posts. Your site will have a static sitemap listing all the pages and a dynamic one listing the blog URLs.
  3. You want to collect the blog posts of a particular year in one sitemap. There will be multiple year-wise sitemaps, each corresponding to a specific year.
  4. You have more than 50,000 URLs on your site, or your current sitemap exceeds 50 mb in size. If the sitemap exceeds the limits, you’ll have to create a new sitemap.

Here I’d like to add that all sitemaps remain in use unless the site owner discards them. 

If you have n sitemaps installed on your site, search bots will access all of them as long as they are free from errors.

When creating multiple sitemaps, you can set the crawl priority for each sitemap. The ones that get updated frequently can have higher priority over others and vice versa.

Designing XML Sitemap Index

Say you have crossed the limitation of one XML sitemap. The next step would be to create another sitemap.

But, how about connecting those 2 sitemaps so that the crawlers understand that the URLs in both sitemaps are indeed connected/

You can do so by designing a XML sitemap index file which includes references to different sitemaps and forming an umbrella for all of them.

This is what an XML sitemap index will look like:

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

<sitemapindex xmlns=”″>










As you can see in the above code, the sitemap index refers to two sitemaps: sitemap1.xml.gz, and sitemap2.xml.gz. 

Now, why is an XML sitemap index important?

Sitemap index, as stated earlier, helps the Google bots understand the various connections of the web pages in a website. Besides, it serves as the major structure through which the crawlers can visit other sitemaps.

Additionally, XML sitemap index makes the job of indexing easier for the crawlers.

How XML Sitemaps Boost SEO?

Sitemaps boost SEO as they help search bots to:

  1. Crawl your site effectively
  2. Index every page on your site
  3. Discover new pages on your site
  4. Know priority of pages on your site
  5. Learn the update frequency and last modified date of a page
  6. Detect duplicate content on your site and notify it

With that, sitemaps also help large websites to organize their information well. 

You can quickly check whether your site has an XML sitemap added to it or not by using RankWatch’s free site checker.

RankWatch website analyzer dashboard

If it shows a green tick, your sitemap is up and running successfully for your site.

What Are The XML Sitemaps Best Practices?

XML sitemaps best practices

Creating a sitemap and creating an SEO-boosting sitemap are two different things. 

You must follow the best practices to ensure you create one that helps search engines crawl your site.

Here are some fundamental best practices for XML Sitemaps:

1. Set Priority For Your Site’s Pages: 

Google’s sitemap guidelines tell you to rank your web pages in order of their relative importance. 

You have to give them a score between 0.1 and 1, where 1 means the highest priority. 

Search bots crawl the pages with high priority more often than those with a lower score. 

The best practice is to assign higher scores to your dynamic pages – the pages with frequent updates. And for static pages, you can set low priority.

2. Categorize Your Pages And Content:

categorizing pages and content

XML sitemaps help search engine spiders to understand your website’s structure and content. 

You must specify the similarities and hierarchies between pages on your site in the sitemap. It helps you categorize your website’s content and form a structure. 

Most websites have a homepage, categories, and subcategories as the primary structure.

If you also have a similar structure, ensure your sitemap has all these URLs in the same hierarchy. 

3. Place Sitemap In The Right Places: 

When it comes to best practices, the placement of a sitemap on your site is important. 

It helps search bots discover the sitemap easily and index your site’s links.

The ideal locations to put your sitemap are your homepage and the root directory. 

4. Set Limits Of URLs For Each Sitemap: 

With a medium or large website in hand, you have many URLs. The best way to organize them is to create dedicated sitemaps.

For example, if you have links for each category, you can create category-wise sitemaps. It will limit the number of URLs you include in each sitemap.

5. Exclude Noindex and Canonical URLs: 

Noindex URLs are those which you mark as non-discoverable. Search bots don’t find and index them. 

You should use noindex tags when you don’t want certain important pages to show in the SERPs. 

However, when it comes to sitemaps, refrain from adding noindex pages to them. It wastes the crawl budget and time and gives a contradictory message.

RankWatch site auditor non-indexable pages

Make sure to check your website on RankWatch’s Site Auditor to check for the presence of noindex pages. 

6. Implement Dynamic Sitemaps If Your Site Updates Frequently:

Dynamic sitemaps get updated automatically when you add or remove pages on your site. The sitemap remains up to date at any given time.

Moreover, dynamic sitemaps are faster to access by search bots. Thus, they save the crawl time. Also, they have fewer chances of being corrupted. 

So, you must implement dynamic sitemaps on your site. It gets modified as per set conditions and stays relevant to the time.

XML Sitemaps Ensure Faster And Better Indexing

With billions of websites on the internet, search bots have a tough time crawling all of them every day. 

You can very well get it as it takes about three months for Google bots to crawl and index a new website. 

However, if you have an XML sitemap in place, you make their task easier. So, add an XML sitemap to your site and leverage its benefits today. 

Moreover, you need to have a reliable tool like RankWatch, throughout the process to ensure that your sitemap is properly implemented, and has zero errors. Besides, once the sitemap is incorporated, RankWatch will prove to be a helping hand in optimizing, auditing, and ensuring that the website is free of errors.

So, what are you waiting for? Signup now and enjoy the benefits of our premium tool.

Share Your Thoughts

Join the Conversation


  1. Should the sitemap be with all its content, or is it enough for the latest content to be available on it? Let’s say the map has the 500 most recent publications. However, should all of them be available on the website visible to users?

Leave a comment

Your email address will not be published. Required fields are marked *

Read more articles

Want to stay on top of the latest search trends?

Get top insights and news from our search experts.


Try Rankwatch Today For FREE !

Start Your FREE 14 Days Trial

25,000+ Active customers in 25 countries use RankWatch as their primary SEO software