XML Sitemaps: The Complete Guide for Beginners (2025)

If you're a website owner, blogger, or digital marketer, you've probably heard the term "XML sitemap." But what is an XML sitemap, and how does it affect your website's performance in search engines?

In this guide, we'll define XML sitemaps and show you their importance to your website's SEO. We'll also go through the different kinds of XML sitemaps, how to create and submit them, common XML sitemap errors, and best practices for keeping your sitemaps up to date.

By the end of this guide, you'll know everything you need to know about XML sitemaps to boost your website's performance in search engine results pages (SERPs).

What is an XML Sitemap?

An XML sitemap is a file that lists the URLs of a website's pages. It includes important metadata about each page, including when it was last updated, how often it changes, and how it relates to the other pages on the site.

Here's an example of how part of a typical XML sitemap would look:

<urlset
	xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<url>
		<loc>https://indexbolt.dev</loc>
		<lastmod>2025-03-10T15:52:54.215Z</lastmod>
	</url>
	<url>
		<loc>https://indexbolt.dev/blog</loc>
		<lastmod>2025-03-10T15:52:54.215Z</lastmod>
	</url>
	<url>
		<loc>https://indexbolt.dev/about</loc>
		<lastmod>2025-03-10T15:52:54.215Z</lastmod>
	</url>
	<url>
		<loc>https://indexbolt.dev/contact</loc>
		<lastmod>2025-03-10T15:52:54.215Z</lastmod>
	</url>
	<url>
		<loc>https://indexbolt.dev/docs</loc>
		<lastmod>2025-03-10T15:52:54.215Z</lastmod>
	</url>
	<url>
		<loc>https://indexbolt.dev/tools</loc>
		<lastmod>2025-03-10T15:52:54.215Z</lastmod>
	</url>
</urlset>

XML sitemaps are formatted in a way that can be understood by search engine bots. They essentially act as a "map" of a website's pages and are a signal to search engine bots about where to go on a website.

Why are XML Sitemaps Important?

So, why should website owners bother creating XML sitemaps? There are three key reasons:

  1. Sitemaps help search engine bots find your website pages: For new or "lightly linked" websites, it can be tough for search engine bots to find all your pages. An XML sitemap acts like a cheat sheet for search engine bots, allowing them to find all your pages quickly and easily. Even for established websites with lots of backlinks, sitemaps ensure that search engine bots can find every page.
  2. Sitemaps can help with the indexing of low-authority pages: XML sitemaps can be especially helpful for ensuring that low-authority pages (like blog posts or product pages) are indexed. Since search engine bots treat all the pages listed in a sitemap equally, submitting a sitemap gives every page equal opportunity to get indexed. This is particularly valuable for pages with few internal links.
  3. Sitemaps provide useful metadata about your pages: The information contained in an XML sitemap can help search engines understand the content and context of your pages better. For example, showing how closely related different pages are can help search engines prioritize indexing those pages together.

Types of XML Sitemaps

There are three major types of XML sitemaps:

  1. Sitemap Index Files: These are sitemaps that directly link to other sitemaps. They're useful for large websites that have multiple XML sitemaps, as they allow you to keep all your sitemaps organized in one place. You can think of sitemap index files as "sitemap sitemaps." According to Google's documentation, a single sitemap index file can link to a maximum of 50,000 sitemaps and can't be larger than 50MB.
  2. Image Sitemaps: These sitemaps include information about the images on your website. If you're a photographer or have a website where images are the main focus, creating an image sitemap can help your images get indexed and appear in Google Image Search.
  3. Video Sitemaps: These sitemaps provide information about the videos hosted on your website. If you have a website that features a lot of videos (like a video tutorial website or a TikTok blog), creating a video sitemap can help your videos get indexed and appear in Google Video Search.

In addition to these three major types of sitemaps, you can also find some lesser-used types:

  • News Sitemaps: These sitemaps are specifically for news publishers and include information about news articles published within the last 48 hours. They're used to help articles appear in Google News.
  • App Sitemaps: App sitemaps help search engines discover mobile apps. You can include links to your app in your regular XML sitemap or create a dedicated app sitemap.

For most website owners, a regular XML sitemap that includes only your website's URLs will be sufficient. However, if you have a large website that fits one of the categories above, you might want to consider creating additional types of XML sitemaps.

How to Create an XML Sitemap

Ready to create your first XML sitemap? In this section, we'll go over three ways to create sitemaps:

  1. Manually creating sitemaps
  2. Using XML sitemap generator tools
  3. Using CMS plugins for WordPress and other content management systems (CMSs)

Manual Sitemap Creation

The simplest way to create an XML sitemap is to do it manually. This is useful if you only have a few pages on your website or want to customize your sitemap. Just make sure to follow the XML sitemap protocol.

To create an XML sitemap manually, follow these steps:

  1. Create a new file and name it "sitemap.xml."
  2. Write the XML code for the sitemap. Include the URL of each page on your website, making sure to include the following data for each page:
  • <lastmod>: The date the page was last modified. Use the format YYYY-MM-DD.
  • <changefreq>: How often the page is updated. This can be any of the following values: always, hourly, daily, weekly, monthly, yearly, or never.
  • <priority>: The importance of the page relative to the other pages on your site. Values can range from 0.0 to 1.0, with the default for all pages being 0.5. Here is an example of how an XML sitemap would look with these three data points:
  1. Upload the sitemap file to the root directory of your website. This will usually be public_html or www.
  2. Once you've uploaded the file, go to http://example.com/sitemap.xml to confirm that your sitemap is live. Replace "example.com" with your actual domain name.

If you don't want to write the XML code yourself, you can use an XML sitemap generator. These are online tools that automatically create sitemaps for you. All you need to do is input your website URL, and the tool will crawl your website and generate an XML sitemap.

Here are some popular (and free) XML sitemap generator tools:

  • Screaming Frog SEO Spider: A free desktop tool that lets you create sitemaps and also analyze your website's SEO. The free version allows you to crawl up to 500 pages, but you can create unlimited sitemaps with the paid version.
  • XML-sitemaps.com: A free online tool for creating XML sitemaps. You can only crawl up to 500 pages in the free version, but you can upgrade to increase the crawl limit.
  • SiteMap Generator: A free online sitemap generator that can also crawl up to 500 pages. You'll need to pay to increase the crawl limit.

All these tools work in basically the same way: After entering your website URL, they will crawl your website, generate an XML sitemap, and give you the option to download it.

Sitemap Generator Tools

If you don't want to create your sitemap manually and prefer to use a sitemap generator, you can install a plugin on your CMS that will automatically create and update your sitemap for you.

For WordPress, here are some popular sitemap plugins:

  • Yoast SEO: This is the most popular SEO plugin for WordPress, with over 24 million downloads. It has a built-in feature that automatically generates and updates sitemaps.
  • All in One SEO: A popular WordPress SEO plugin with over 3 million active installations. It also has a built-in sitemap feature.
  • XML Sitemap Generator for Google: A simple plugin that automatically generates an XML sitemap without any extra features or complexities.

You don't need to install a special plugin to create sitemaps with other CMSs, like Joomla or Drupal. If you're using one of these systems, sitemap creation and management are typically built in by default. Here are a couple of examples:

  • Next.js Sitemap Generation: Next.js includes built-in sitemap generation capabilities that allow you to create static or dynamic sitemaps with minimal configuration.
  • Drupal's XML Sitemap Module: Similar to WordPress, Drupal has to install a module to generate sitemaps automatically.

No matter which CMS you're using, you can easily find instructions for enabling XML sitemap generation on the official documentation or by doing a quick Google search.

How to Submit an XML Sitemap to Google Search Console

Once you've created your XML sitemap, the next step is to submit it to Google Search Console (GSC). Submitting a sitemap informs Google that your sitemap exists, which can help it get crawled and can speed up the indexing of your pages.

To submit your sitemap to GSC, follow these steps:

  1. Go to the Sitemaps report in Google Search Console.
  2. Enter the URL of your sitemap in the "Add a new sitemap" section. This will be http://indexbolt.dev/sitemap.xml.
  3. Click the "Submit" button.

After you submit your sitemap, Google will tell you how many URLs it contains and whether it has detected any errors. It can take a little while for Google to crawl all the URLs in your sitemap, so don't be alarmed if the number of submitted URLs doesn't immediately match up with the number of URLs in your sitemap.

XML Sitemap Best Practices

Want to get the most out of your XML sitemaps? Follow these best practices to ensure your sitemaps are doing their job effectively.

Sitemap Updates

Make sure to keep your sitemap up to date. Google recommends updating your sitemap whenever you add, remove, or modify pages on your site. If you don't, Google may get confused about which pages on your site are real and active.

The good news is that if you're using a CMS plugin to manage your sitemap, it will automatically update your sitemap for you. However, if you're creating your sitemap manually, you'll need to remember to update your sitemap regularly.

URL Prioritization

You can assign priority values to the pages in your sitemaps to show search engines which pages are the most important. In theory, this should help important pages get indexed faster.

However, Google has explicitly stated that it does not use priority values to influence crawling or indexing. In fact, the Google Search Central Team has tweeted multiple times that you shouldn't rely on sitemaps to get your important pages crawled and indexed.

So, while you can assign priority values in your XML sitemaps, they won't have any positive impact on your pages' indexing or rankings. In fact, Google recommends against using priority values to avoid creating "misleading impressions of importance" among sitemap pages.

Sitemap Size Limits

There are limits to how big your XML sitemap can be. According to the Sitemaps Protocol, a regular XML sitemap can have a maximum of 50,000 URLs and a maximum file size of 50MB (unzipped). If you exceed either of these limits, you'll need to create multiple sitemaps and use a sitemap index file to contain them.

Sitemap index files have much larger limits. According to Google, a sitemap index file can include links to a maximum of 50,000 sitemaps. Size wise, there are no specified limits, but "the total size of the files referenced by a sitemap index file should be less than 50MB."

Robots.txt and Sitemaps

Your robots.txt file and XML sitemap can work together to improve the crawling and indexing of your pages. Following the best practices below will ensure that your robots.txt file isn't blocking access to any of the pages in your sitemap.

  • Don't disallow your sitemap: Ensure that your robots.txt file isn't blocking access to your XML sitemap. If it is, search engines won't be able to find your sitemap, which will prevent them from knowing about your pages. To check if you're blocking your sitemap, look for a line that says Disallow: /sitemap.xml in your robots.txt file. If you find it, simply remove it.
  • Don't disallow pages in your sitemap: Remember that any pages you've blocked in your robots.txt file won't get crawled or indexed. If there are important pages on your website that you want to make sure are crawled and indexed, avoid blocking them in your robots.txt file.
  • Keep your sitemap and robots.txt simple: Both files can get complicated quickly, especially if they contain multiple rules. Keeping them as simple as possible can help prevent errors.

If you're new to robots.txt files, check out our complete guide to robots.txt files.

Sitemaps and Website Structure

Your XML sitemap should reflect the structure of your website. If your sitemap's structure looks different from how your website is organized, it can create confusion for search engines. This confusion can negatively impact the crawling and indexing of your pages.

Additionally, a well-organized website structure can help both users and search engines navigate your site with ease. Make sure that your important pages are located just a couple of clicks away from your homepage and are easy to find.

Common XML Sitemap Errors

Once your XML sitemap is submitted to Google Search Console, you can monitor it for errors and issues. In this section, we'll go over some common XML sitemap problems and how to fix them.

"Sitemap Could Not Be Fetched" Error

The "sitemap could not be fetched" error is a general error that means Google is unable to access your sitemap. There are a few reasons why you might be getting this error.

  • Your sitemap URL is incorrect: If you submitted the wrong URL for your sitemap, Google won't be able to find it. Double-check to make sure the URL you submitted is correct.
  • Your server is down: If your server is temporarily down, Google won't be able to access your sitemap. If you suspect this is the case, wait a while and then check to see if the error is still there.
  • You've blocked Google: Check to see if you've accidentally blocked Google from accessing your sitemap in your robots.txt file. Your sitemaps should not be listed under the "Disallow" rule.
  • There are network issues: In rare cases, network issues can prevent Google from accessing your sitemap. Unfortunately, this is something you won't be able to fix.

If none of these reasons seem to apply, try to validate your sitemap or use a sitemap validator tool. Validator tools will point out any errors or issues in your XML sitemap, including structural problems, problems with your sitemap's formatting, and issues with the URLs in your sitemap.

"Sitemap is HTML" Error

The "sitemap is HTML" error means that Google expected to find an XML sitemap, but instead it found an HTML page. This is a common mistake caused by submitting the wrong URL for the sitemap or failing to configure the sitemap correctly.

To fix this error, ensure that the URL you're submitting to Google really is pointing to an XML sitemap and not an HTML page.

"URL Not Allowed" Error

The "URL not allowed" error means that a page in your sitemap is not permitted in sitemaps. This can happen for a number of reasons.

  • Your URL is a redirect: If a page in your sitemap is a redirect to another page, you won't be able to directly index that redirected URL. Instead, you should add the destination URL to your sitemap. For example, if your blog URL is http://blog.example.com and you've set up a redirect to http://example.com/blog, you should only add http://example.com/blog to your sitemap.
  • Your URL is a fragment: URLs with fragments (the part after the #) are not allowed in sitemaps. For example, this URL http://example.com/page#section1 would cause an error.
  • Your URL is a local file: Local files, like those beginning with file:/// are not allowed in sitemaps.
  • Your URL is blocked by robots.txt: If a page in your sitemap is blocked by robots.txt, it won't be able to get crawled. However, since blocking a page with robots.txt is a common practice for many website owners, Google does not recommend preventing pages from being linked in sitemaps. If an important page on your site is linked in your sitemap and you want to ensure it gets crawled, avoid blocking it with robots.txt.
  • Your URL is from a different protocol or domain: All the URLs in your sitemap must belong to the same domain and protocol. For example, if your sitemap is under http://example.com, all the URLs in your sitemap must also be under http://example.com and not be links to any HTTP or local URLs.
  • Your URL is generated by a script: Some dynamic URLs generated by forms or scripts may be disallowed in sitemaps. This includes URLs that require a login, include session IDs, or expire after a set amount of time.
  • Your page is a search result: Search result pages from on-site search engines should not be included in sitemaps.

If none of these reasons apply, you can also use a sitemap validator tool to get more information about the "URL not allowed" error.

Sitemap Validator Tools [Link to free sitemap validator tool]

If you want to ensure your XML sitemap doesn't contain any errors, you can use a free sitemap validator tool. Validator tools check your sitemap against the sitemaps protocol standard and point out any errors or issues.

Here are a couple of free sitemap validator tools:

  • Sitemap Validator: This online tool lets you upload your sitemap or paste your sitemap URL. After running a check, it will list any errors or warnings, along with details about each one.
  • Seoptimer: Another free online sitemap validator. It checks your sitemap against the sitemaps protocol and also against Google's guidelines.

Beyond XML Sitemaps: Other Indexing Strategies

XML sitemaps are a great tool for getting your website pages indexed. However, they're not the only tool at your disposal. In this section, we'll go over some other strategies for getting your pages indexed.

Internal Linking

One of the best ways to help search engines discover and index your pages is to link to them from other pages on your site. Internal linking is a simple yet effective strategy for ensuring that all your important pages get indexed.

There are two key internal linking tactics for indexing:

  1. Link to important pages from many relevant locations: The more contextually relevant links you have pointing to a page, the more likely it is that search engines will discover and crawl that page. Think about all the different locations where you can naturally link to a page on your website. For example, if you have an important service page, make sure to link to it from your blog posts, other service pages, and your homepage.
  2. Use relevant keyword anchor text: The anchor text of your internal links provides search engines with important contextual information about the linked page. To help search engines understand the topic of your linked pages, use relevant keyword-based anchor text. However, don't overdo it; try to keep your internal links natural and avoid manipulatingKeyword rankings withexactmatch anchors.

Read our complete guide to internal linking for more tips on using internal links as an indexing strategy.

External Backlinks

Backlinks from other websites not only help with your pages' rankings but also act as signals to search engines that your pages are relevant and can be trusted. In fact, backlinks are one of the top ranking factors, according to multiple SEO studies.

Theoretically, if a page on your site is linked to from a lot of other sites, search engine bots will follow those links and discover and index that page. Because of this, building links to your important pages can be a helpful strategy for getting those pages indexed.

Website Speed and Mobile-Friendliness

For a page to be indexed, a search engine bot needs to be able to access and view every aspect of that page. If there are any issues that prevent a bot from loading or seeing a page, it may not be able to index that page.

Two common factors that can prevent search engines from fully loading a page are poor website speed and mobile performance. If your site is slow and the pages take a long time to load, a search engine bot may timeout before it finishes loading the entire page. Similarly, if a page doesn't fully load on a mobile device, a search engine bot won't be able to index any of the elements that aren't loading.

Ensuring that your site is fast and mobile-friendly will help search engines load all the elements of your pages so that they can be properly indexed.

Conclusion: XML Sitemaps - A Key SEO Tool

From the information in this guide, you hopefully now have a good understanding of XML sitemaps and their importance for your website's indexing and SEO.

If you need a hand speeding up the indexing of your website, check out IndexBold.dev: A powerful new tool that can help get your pages indexed quickly and easily by blasting them to top search engine Sphesians.