XML Sitemap in SEO: Importance, Benefits, Setup & Common Mistakes
What is an XML sitemap in SEO? An XML sitemap is a file that lists the pages, videos, images and other content on your website so that search engines can more easily crawl your site. While a sitemap will help to discover your URLs, crawling, indexing and ranking will be dependent on the quality of your content and the internal linking.
An XML sitemap file is usually placed in the root directory of your domain and is recommended by Google Search Central. It is based on the ‘Sitemap Protocol’ and has specific mandatory and optional elements. This guide explains how to structure your sitemap, different types of sitemaps and how to set up, submit and troubleshoot.
What Is an XML Sitemap in SEO?
An XML sitemap (sitemap.xml) is a file that contains a list of all the URLs on your website so that they can be found, crawled and indexed by search engines. An XML sitemap can also contain extra information (metadata) to help search engines understand when content has been updated on your site. A sitemap serves as a hint, but Google decides which URLs from your sitemap to actually crawl and index.
What Does an XML Sitemap Look Like?
A basic XML sitemap places each page in a URL entry inside a urlset element, as the following XML sitemap example shows:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2026-10-28</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://www.example.com/about/</loc>
<lastmod>2026-10-24</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://www.example.com/products/</loc>
<lastmod>2026-10-26</lastmod>
<changefreq>daily</changefreq>
<priority>0.9</priority>
</url>
</urlset>
Importance and Benefits of XML Sitemaps for SEO
An XML sitemap matters because it tells search engines which URLs a site owner considers important. Crawlers can use it to discover pages and plan visits.
URL Discovery for New and Large Websites
Google names three situations where a sitemap helps most. These are as follows:
-
Your site is large: On larger sites, sometimes it is difficult to make sure that every page is linked by a minimum of one page on the site.
-
Your website is new and has few external links: Googlebot and other web crawlers crawl your website by accessing URLs found from previously crawled pages. If there are fewer backlinks, Googlebot may not discover your pages. Leaving these entry points undiscovered during site expansions can trigger an unexpected website traffic drop.
-
Your website has rich media content or is shown in Google News: Adding a sitemap for websites that have rich media content (such as videos and images) provides the search engine additional information from sitemaps to take into account for search.
Orphan Pages, Internal Linking and Crawl Efficiency
Orphan pages are websites that do not have links anywhere else on your website. A sitemap can show crawlers that these pages exist. Using interlinks and adding them to the sitemap helps them to connect with your website.
Checking website structure and crawlability alongside the sitemap shows which orphan pages need a link from related content. On large websites, a sitemap limited to canonical, indexable URLs can help crawlers focus on pages worth indexing.
Understanding XML Sitemap Structure and Tags
An XML sitemap gives metadata about specific pages, which helps crawlers prioritise how they can crawl your website.
Required Tags: <urlset>, <url> and <loc>
A valid sitemap.xml requires three tags: <urlset>, <url> and <loc>. Below is a quick look at their importance for crawler sitemaps:
-
<urlset>: This tag wraps the entire sitemap file.
-
<url>: Wraps one URL entry.
-
<loc>: Under this tag, mention the URL you want to be indexed.
Lastmod, Changefreq and Priority: Which Tags Matter to Google?
Google prioritises only <urlset>, <url> and <loc> for XML sitemaps. <lastmod>, <changefreq> and <priority> tags are optional tags.
The following table explains the purpose of XML tags and Google’s interpretation:
|
Tag |
Purpose |
Required? |
How Google Interprets It |
|
<urlset> |
Encloses the entire sitemap and declares the XML protocol schema. |
Yes |
Google treats it as the root element. |
|
<url> |
Contains a single URL entry along with its related metadata tags. |
Yes |
Google uses it to separate the data of one page from that of another. |
|
<loc> |
Specifies the full, absolute URL of the page, including the protocol (https://). |
Yes |
Google uses this value to locate the page for crawling. |
|
<lastmod> |
States the date on which the page content was last modified. |
No |
Google treats it as a hint for crawl scheduling when the date is accurate. |
|
<changefreq> |
Estimates how frequently the page content is updated. |
No |
Google ignores it. |
|
<priority> |
Indicates the relative importance of a page on a scale of 0.0 to 1.0. |
No |
Google does not use it. |
Types of XML Sitemaps and Their Uses
Google uses four types of sitemaps: standard XML sitemaps, image and video sitemaps, Google News sitemaps and multilingual sitemaps using Hreflang. Here are the uses of each of these sitemaps:
Standard XML and Sitemap Index Files
A standard XML sitemap details a site’s primary text-based canonical URLs along with supporting metadata such as the <lastmod> (Last modification time) tag. As specified in Google’s large sitemaps guide, a single sitemap file is capped at a maximum of 50,000 URLs and 50MB uncompressed. Websites that exceed these metrics must use a sitemap index file (<sitemapindex>), which serves as a master directory file to point to multiple individual sitemaps.
Image and Video Sitemaps
Google leverages specialised extensions to index rich media assets. Here is how image and video sitemaps work:
Image Sitemaps
Image sitemaps help let Google know about your site's images. They're particularly useful for images that Google would otherwise not be able to find, such as images found via JavaScript code. You can have a separate image sitemap or include image sitemap tags within your existing sitemap. Either option will work equally well with Google.
• Required Tag: <image: loc> (specifies the direct URL of the image) and <image:image> (Encloses all information about a single image and each <url> tag can contain up to 1,000 <image:image> tags.)
Video Sitemaps
A video sitemap is built using the http://www.google.com/schemas/sitemap-video/1.1 namespace. In order to receive rich video features in search results, Google requires certain tags to be used.
Required Video Tags:
• <video:thumbnail_loc>: Points to the video thumbnail image URL.
• <video:title>: The title of the video.
• <video: description>: A description of the video (maximum 2048 characters).
• Direct Source Path (Must include at least one of the following):
• <video:content_loc>: The direct URL to the raw video file.
• <video:player_loc>: The URL pointing to a player for a specific video.
Google News Sitemaps
Designed for high-velocity information, these sitemaps use a custom <news: news> namespace to alert Googlebot-News to new reporting. Per Google's News Sitemap Rules, they must only contain articles published within the last 48 hours and have a strict volume ceiling of 1,000 URLs per file. Required metadata tags include <news:publication>, <news:publication_date> and <news:title>.
Multilingual Sitemaps (Hreflang)
If you are targeting an international audience, Google will allow you to include alternative local versions of your page. This can be done using the xmlns:xhtml="http://www.w3.org/1999/xhtml" namespace. You can include tags that target specific languages and countries. As stated in Google's Internationalisation guidelines, it is important to ensure that you have fully linked both ways between each version so that the data is not ignored by Google.
The table below summarises each sitemap type:
|
Sitemap type |
Intended use |
Websites that benefit |
|
Standard XML and index files |
Lists core URLs for crawling and groups multiple sitemaps when URLs exceed 50,000. |
All websites, especially large e-commerce platforms, blogs and corporate sites. |
|
Image sitemaps |
Identifies images on pages to improve visibility in image search. |
Photographers, portfolios, e-commerce stores and visual blogs. |
|
Video sitemaps |
Provides video metadata, such as duration and thumbnails, to support rich video snippets. |
Video platforms, online course providers and media streaming sites. |
|
Google News sitemaps |
Helps Google discover fresh news content within a 48-hour window. |
News portals, digital magazines and active media outlets. |
|
Multilingual (hreflang) sitemaps |
Maps localised and translated page versions to the correct regions. |
International businesses, global e-commerce sites and multilingual blogs. |
Sitemap Index Files for Large Websites
A sitemap index file acts as a master directory to manage expansive architectures efficiently. Evaluating the hierarchy of these master files is a standard milestone in a technical SEO audit.
The following sections outline the technical guidelines governing these files and how to structure them logically:
Sitemap Index Structure
To facilitate efficient search engine crawling and prevent server timeouts, each sitemap is capped at a maximum of 50,000 URLs and 50 megabytes uncompressed. If you reach this limit, it will automatically be split into multiple files. This applies to the index file too, meaning you can scale your sitemap very well for larger enterprise sites.
Organising Multiple Sitemaps by Content Type
Segmenting sub-sitemaps by their content type gives a much easier way to handle your data. This means you can easily check how the indexing is going and what areas may need developing.
By classifying your site, you can divide your URLs into the following groups:
-
Product pages
-
Blog posts
-
Category Archives
-
Media assets
XML Sitemap Requirements for Different Website Types
Sitemap needs may vary by website type. Below are some websites and preferred XML sitemap options:
Blogs and Small Business Websites
Small business websites can use simple sitemaps. This means that only one XML file is required to list all of your main static pages. It makes it easier for your small site to have simple navigation to help with your static pages, such as contact us pages, service pages and resource pages.
E-commerce Websites with Products and Categories
For e-commerce platforms, segmenting products and category pages into different sitemaps allows search engines to crawl and prioritise updates more efficiently. In addition, conducting an ecommerce SEO audit helps ensure that product catalogue shifts, discontinued items and dynamic inventory changes are properly reflected in these dedicated feeds.
News and Publishing Websites
Real-time publications have specific formatting rules. Publishers have a specific namespace containing only editorial content from the last 48 hours. This allows real-time content to be easily separated into different categories such as new bulletins, old publication archives and relevant media assets.
Large, Dynamic and Multilingual Websites
For a large number of URLs, international links should be managed through adding local hreflang tags to your configuration file. Global properties can be created using specific nodes such as localisation, dynamically generated registries and master indexes. Establishing these complex multi-region feeds is routinely managed through dedicated best seo services in jaipur.
How to Create an XML Sitemap
An XML sitemap acts as a standardised machine-readable inventory of your site’s URLs and metadata (such as modification dates). Search engines parse these files to prioritise and discover content efficiently. Depending on how your website is built, you can configure your sitemap automatically through your CMS or create it externally.
Generate a Sitemap Using WordPress, Shopify or Other CMS Platforms
Most CMS platforms generate a sitemap automatically. Top platforms can do this as follows:
-
WordPress: This tool can generate a basic sitemap under the URL /wp-sitemap.xml. If you use an advanced SEO plugin such as Yoast SEO, you’ll get an editable sitemap under /sitemap_index.xml.
-
Shopify: It lets you create a parent sitemap under the URL /sitemap.xml. As explained in their help centre, Shopify will automatically separate your website into individual files, with product, page and blog sections of your store under control of your crawl budget.
-
Wix: The cloud-based platform can create and publish your XML document under your main root domain. As explained in the comprehensive Wix SEO Guide, your website will automatically generate updates. Also, if there are any broken URLs, these will be automatically cleared.
Create an XML Sitemap Manually or with a Generator
If your platform isn’t automatically generating dynamic sitemaps for you, you can use automated tools to crawl your domain or manually create one.
Option 1: Using Automated Tools
You can use a dedicated XML sitemap generator such as the Screaming Frog SEO Spider. This will crawl your whole website, pull out any valid links and identify any broken pages. The software will also automatically format your URLs so they stay under the 50,000 link limit set out in the Sitemaps.org Protocol.
Option 2: Manual Creation
If you have a small number of static pages on your website, you can manually create your sitemap. Simply open up a simple text editor and type in the tags given in the Sitemaps.org Schema Specification. Then enter your real page links. Save your file as .xml.
How to Submit and Check an XML Sitemap
Once your XML sitemap has been created, it can be submitted to help search engines use it. You can submit your sitemap in the following ways:
Submit Your Sitemap Through Google Search Console
Google Search Console sitemap can be managed in the following three ways:
-
Submit your sitemap through the Sitemaps report within Search Console so you can see when Googlebot crawled your sitemap, plus any processing issues.
-
Use the Search Console API to programmatically submit a sitemap.
-
Add the following line in your robots.txt anywhere, specifying the path to your sitemap: https://example.com/my_sitemap.xml.
Submit To Bing
Log in to Bing Webmaster Tools. Go to the Sitemaps section and paste your full URL. To follow the Sitemaps.org protocol, add a new line to your robots.txt file named 'sitemap'.
View Sitemap Status & Discovered URLs
Check that your sitemap has a green status showing success. If there are any errors, click on the row to diagnose issues like invalid formatting. Check your Discovered URLs column to see how many unique pages were able to be crawled by the crawler.
XML Sitemap Best Practices
The checklist below covers the points to verify before publishing and after major updates:
-
All URLs are canonical and return valid 200 HTTP status codes.
-
All URLs are absolute with protocol and host.
-
The lastmod field is set to the actual date the content was changed.
-
The file updates automatically when the content has been changed.
-
The file is publicly available with a permanent URL.
-
There are less than 50,000 URLs and 50MB of uncompressed data in the file.
-
The file follows the robots.txt rules and excludes any blocked URLs.
Common XML Sitemap Errors and Fixes
Technical mistakes, broken URLs and incorrect configurations cause search engines to reject your file. These technical sitemap errors can prevent crawlers from being able to access your site and will waste search engines' resources.
Invalid XML, Incorrect URLs and Sitemap Fetch Errors
To fix invalid XML format, make sure that all tags have corresponding closing tags, such as <url>
<loc>http://www.example.com/</loc> </url>.
To fix incorrect URLs, check if all of them are well-formed and are correctly encoded, like <loc>http://www.example.com/page</loc>.
In Google Search Console, site not fetched means Google could not retrieve the sitemap file itself. To fix this issue, open the sitemap URL in a browser. If it does not load, the website is incorrect. Next, check your robots.txt (yoursite.com/robots.txt) and make sure nothing is blocked in the sitemap. Once the load is fine, go back to Search Console and resubmit.
Noindex, Redirected, Duplicate or Broken URLs in Sitemaps
A sitemap should list only the pages you want indexed. Pages with a noindex tag, redirected pages, duplicate pages and pages that return a 404 error do not belong in it. Many of these mistakes come from confusing robots.txt vs noindex. Robots.txt stops a page from being crawled. Noindex is a tag on the page that keeps it out of search results.
To fix these issues, configure the script to list only pages marked with a noindex tag in Google Search Console. If you find the ‘noindex’ tag on a URL that must be indexed, remove the noindex directive. To fix redirected, duplicate or broken link issues, check for redirects under Google Search Console’s Indexing > Pages in the left sidebar. Here you will see errors like 404 (Not found) or pages with redirects (301/302). For 404 errors, remove or fix the URL with the right address. To fix 301/302 errors, swap out any redirecting links with their final, absolute canonical URL destination.
To remove duplicate URLs from sitemap.xml, click on the Page indexing report of Google Search Console, scroll down to the ‘Why pages aren’t indexed’ section and click on ‘Duplicate Without User-Selected Canonical’. Open the “Duplicate without user-selected canonical” report and click a listed URL, then use Inspect URL to see which version Google picked as canonical.
Next, add a canonical tag (or a 301 redirect) on each duplicate pointing to your preferred URL, and remove the duplicates from your sitemap.xml so it lists only canonical pages. Finally, resubmit the sitemap in Search Console and click Validate Fix in the report.
Submitted URLs That Remain Unindexed
Although crawlers find your sitemap, they are not indexing your URLs as they are not passing quality tests. This loss of crawl efficiency often leaves critical URLs categorised as ‘crawled - currently not indexed’ in search reports.
Improve your thin content, remove any internal doorways, remove duplicate boilerplate designs and ensure you have clear internal linking between all of your key pages.
Outdated Lastmod Dates and Missing Sitemap Updates
Automation scripts that modify the <lastmod> time on every single page crawl without real content updates reduce the reliability of the lastmod signal.
To fix this issue, ensure your sitemap code is only updating based on when your database was last updated. This will mean your lastmod string will reflect the real changes made.
Why Choose The Cogent for Technical SEO?
A sitemap performs best when the rest of a website supports it. At The Cogent, we review sitemap files alongside robots.txt rules, canonical tags, redirects, internal links as well as indexing reports. We begin with an in-depth technical audit to identify underlying issues, then implement the necessary fixes directly through website development.
Searching for the best digital marketing company in Jaipur to handle technical SEO? Get in touch with us today for all your technical SEO needs.
Conclusion
The main benefit of having an XML sitemap is to help search engines locate the most important pages for the website owner. However, crawling, indexing, ranking and traffic will all depend on the quality of your content and website as a whole. To make sure you’re getting the most out of your sitemap, you should ensure it’s accurate and keep it up-to-date. For an independent expert check, a technical audit can confirm that every listed URL belongs in the file.
Frequently Asked Questions
Smaller, well-linked sites may not require them, but larger or newer sites or those with lots of media should use an XML Sitemap.
XML Sitemaps are used by search engines to crawl your site, HTML sitemaps are pages to help users navigate.
XML sitemap is commonly placed in /sitemap.xml or /sitemap_index.xml. You can also find the exact location in your robots.txt.
Larger sites commonly have multiple sitemaps. You can list them all within one index file.
No. Google will decide which URLs they want to crawl from your listed sitemap.
Your XML sitemap should always be up to date with all new additions, deletions, redirects and major changes. This can be easily achieved by using an automated tool.
Only canonical pages that can be indexed (200 Status). Pages that are redirected, noindex, blocked or errors shouldn’t be in the XML sitemap.
No. The protocol doesn’t care what order they are in.
It can show crawlers there are orphan pages. But proper orphan page connections within the site are built through internal links.
Indirectly. They will help to discover URLs, but the quality of your content as well as how many pages can be crawled will determine how visible your website is.


