REQUEST DEMO OnPage Champ is launched on Product Hunt. Don't forget to support us there.

What is an XML Sitemap? Why and How to Create One?

What is an XML Sitemap? Why and How to Create One?

What is an XML sitemap?

In simple terms, an XML sitemap is a list of all the URLs present in a website. 

XML stands for ‘eXtensible Markup Language’ and is a standard file format used for sitemaps.

Consider a sitemap as the blueprint of a website, containing paths to important pages or files of your website. 

I know what you must be thinking now.

Why should I care about an XML sitemap?

Presence of an XML sitemap for a website increases the probability of it getting crawled and indexed by search engines, but it doesn’t guarantee anything. 

However, it can still benefit your site in most cases. Wondering how?

Google reads a website sitemap before it starts crawling it, so in a way a sitemap defines the entry point to your website structure.

If you don’t have a sitemap, Google will still crawl your website. It’s just that having a sitemap gives Google the right direction. 

In short, it tells search engines where to find the most important pages on your website, even if they aren’t linked to any other page on your site. 

And on the bright side, you will never be penalised for having an XML sitemap. 

If you are still not convinced, consider these benefits of having a sitemap: –

  1. It helps you overcome the limitations of weak internal linking.
  2. It helps large sites get better and more organised indexation.
  3. It can increase the chance of improving your rank (through faster and better indexing)

What does a sitemap look like?

An XML sitemap is written in a machine-readable format. It is not intended to be viewed by users. 

Here’s a simple Sitemap that contains just one URL and uses all optional tags:

XML sitemap

One important thing to note is that a sitemap limits restriction to 50MB (uncompressed) and 50,000 URLs.

If you have a larger file or URLs, then you will need to create multiple sitemaps. If you decide to provide multiple sitemaps, you should then list each sitemap file in a sitemap index file. 

Here’s how a sitemap index that lists two sitemaps looks like: 

Two sitemaps example

Some other types of sitemaps include:

1. Video sitemap

A video sitemap contains additional information about videos hosted on your website or web pages. 

It enables Google (or any other search engines) to easily find and understand the video content on your page. 

Here’s an example:

Video sitemap

2. Image sitemap 

Image sitemap is there to help search engines discover images on your site that might not be found otherwise. 

You can indicate all the images that you want search engines to crawl and index from your site. 

This is how an image sitemap looks like:

Image sitemap

Note that you can only list up to 1,000 images for each page. 

What information does a sitemap carry? 

Sitemaps carry important information for search engines. These include: 

1. Lastmod attribute

The lastmod attribute tells the date when the file was last modified. This date should be in the W3C datetime format. But you can omit the time part if you wish.

It is one of the most valuable pieces of information.  

Instead of crawling the entire website and checking if anything has been changed, search crawler can just check the last updated file in the sitemap. 

This way, your page gets crawled sooner and also saves your crawl budget.

Crawl budget is simply the number of pages Google will crawl on your site in a day. Yes, Google doesn’t always crawl every page on a website instantly.

2. Changefreq attribute

The changefreq attribute indicates how frequently the page is likely to change. 

But truth be told, it doesn’t contribute much input. The date of the last update is a much better indicator than change frequency. 

This attribute is not one of the top priorities for search engines. 

3. Priority attribute

The priority attribute is used to indicate the importance of one URL to other URLs on your site. 

The value ranges from 0.0 to 1.0. It’s important to note that this value doesn’t affect how your pages are compared to pages on other websites. 

It also doesn’t influence the position of your URLs in a SERP.

But it can be quite useful when two of your pages match the same search query. 

In such a case, search engines might choose to display the one with the highest priority. Thus, one of your most prominent pages gets displayed.

Besides, when your website is new, there are chances that search engines will index the page with higher priority first. 

However, Google completely ignores the priority attribute. As for other search engines (like Bing), they might still use the priority attribute. 

Note: While creating a sitemap, all three attributes are optional fields.

4. Mentioning all regional and language variations for every URL

Google allows you to specify all the language and region variants for each URL. It saves you the trouble of declaring hreflang alternatives for each page. 

You can instead declare all your language variation in one XML sitemap file. 

To know how, you can refer to the official guide from Google.

Which websites need a sitemap?

You might need a sitemap if:

1. You have a large website

When you have a huge website with thousands of pages, there are chances that web crawlers might overlook some of your recently updated pages. 

That’s why it’s great to inform the search engines about all your available URLs for crawling. 

You should also include the lastmod attribute in the sitemap to make it more effective. 

2. Your website has a poor internal linking

Google finds, indexes, and understands all of the pages on your website through both internal and external links. 

If you have a list of pages that aren’t linked to each other or any external link, sitemaps inform Google (and other search engines) about the presence of new and updated pages on your site. 

Note that there is no guarantee that Google will crawl these pages, just an increased probability. 

3. Your website is new

Creating an XML sitemap for a new site with a few or no external links to it can be quite useful. 

When your site is not linked anywhere, search engines might not discover your pages. The easiest way to get search engine attention is by submitting your website and your XML sitemap to Bing Webmaster Tools and Google Search Console. 

4. Your site consists of rich media content

If your website contains a lot of media files, including images and videos, and is often shown in Google News, you should create an XML sitemap. 

Google can then take additional information from sitemaps into account, wherever it deems fit. For instance, it can aid in the quick discovery process when the results are shown for Google images. 

Caveat: Having a sitemap doesn’t guarantee that all your pages or media files will be crawled and indexed. However, it can benefit your site in most cases. And most importantly, you will never be penalised for having a sitemap.

How to create an XML sitemap in WordPress?

Undoubtedly, Yoast is one of the most popular SEO plugins for WordPress websites, and it makes it easy for websites to create an XML sitemap. 

Assuming that you already have a Yoast plugin installed, there are certain steps that you need to follow.

Step #1: Click on ‘SEO’ in the sidebar of your WordPress 

Dashboard tab WordPress Yoast

Step #2: Select the ‘Features’ tab.

In this screen, enable or disable the different XML sitemaps for your website.

Features tab WordPress Yoast

And you are done.

Well that was easy and quick, wasn’t it? 

Now that you have created an XML sitemap, you need to submit it to Google. 

How to submit a sitemap to Google?

The steps are pretty simple. 

Step #1: Head over to the Google Search Console. 

Step #2: On the left sidebar, click on ‘Index’ and then select ‘Sitemaps.’

Sitemaps tab in Search Console

Step #3: On the right hand side, you just need to add your sitemap URL under ‘ Add a new sitemap ‘.

Add a new sitemap in Search Console

Note: When you save your sitemap, you can choose any name. But the standard practice is to stick with ‘sitemap.xml’ or ‘sitemap_index.xml’. 

And in case of multiple sitemaps, you can use sitemap_1.xml, sitemap_2.xml, and so one. 

Step #4: Search console will confirm your submission.  

That’s it. You have successfully submitted your sitemap. 

In fact, after a few minutes of processing, Google will generate a full report of how your sitemap is functioning.

General guidelines by Google

Just so you don’t make any mistake, Google has also laid complete guidelines on building an XML sitemap. 

You can check it out here.

Generale sutemap guidelines by Google

Conclusion

When done right, search engines can easily and quickly discover most of your site. Besides, an XML sitemap improves the crawling of large and complex files. 

That’s why make sure that you have properly formatted and submitted the sitemap to search engines. 

Having an XML sitemap may not be a ranking factor. But then again, you have nothing to lose by having a sitemap. It is only going to bring you benefits. 

Leave a Comment