What Is an XML Sitemap & Why Should Every Website Have It?

Learn what XML sitemap is and how it helps search engines discover your content faster, improve indexing, and strengthen search visibility.

• 
10
min read
what-is-an-xml-sitemap-cover

An XML sitemap is a file that maps your website's URLs, metadata, and structure for search engine and AI crawlers. A well-configured sitemap improves visibility by enabling search engines to discover and index content more quickly.

Despite being standard for over 20 years, sitemaps are still overlooked. SE Ranking found that nearly 15% of websites didn’t have a sitemap in 2025, while those that did often had poorly written ones. 

In this guide, we’ll explain why this can be an issue. You’ll learn:

  • What an XML sitemap is 
  • What elements it contains
  • Why it’s crucial for SEO
  • How to create a sitemap

Key Takeaways

  • An XML sitemap is a text file that tells crawlers what's on your website. It lists your URLs along with metadata like last updates, language versions, and media, and helps bots understand your site's structure before they crawl it.
  • A well-configured sitemap is important for SEO and AI search visibility. It preserves crawl budget, speeds up indexing, and supports specialized search results. Without one, crawlers may miss key content or waste resources on inefficient crawling.
  • Sitemaps follow the Sitemaps 0.90 protocol and use standardized XML tags. Mandatory tags like <url> and <loc> define the file's structure, while optional tags like <lastmod> and extensions provide crawlers with richer context about your content.
  • You can create a sitemap through your CMS, third-party tools, or manually. Regardless of the method, validate the file using Google Search Console before publishing, then place it in your root directory and reference it in your robots.txt file.
  • Follow formatting standards and best practices. Use full URLs, avoid duplicates and redirects, close all tags properly, and update your sitemap regularly to reflect changes on your site.

What Is an XML Sitemap?

An XML sitemap is a text file that lists your website’s pages and content. Search engine and AI bots use the sitemap as a guide when crawling your website. You can use the sitemap to specify what’s important on your website and provide additional data for pages and media, which helps content surface in specialized search results:

Website Element Examples of Data in an XML Sitemap
Page Last update, alternate language versions
Image Location, captions, license
Video Location, duration, rating, age-appropriateness
News Article title, publication date, genre, language

Importance of a Sitemap: Do You Really Need One?

Having an XML sitemap is not mandatory, but for any site that depends on organic traffic, it's hard to justify not having one. 

Crawlers process billions of pages daily. While they can discover your website through internal and external links, a sitemap makes the process more efficient. 

Here’s why having an XML sitemap is important:

  • Saves the crawl budget: Bots have a limited amount of resources they can dedicate to your website—this is your crawl budget. By making it easier to find and understand content, you help preserve resources.
  • Speeds up indexing: Crawlers discover new pages and updates sooner, which matters for blogs, stores, and other websites with frequent changes. Several sources claim sitemaps lead to 47% faster indexing rates and 23% more organic traffic.
  • Surfaces orphan pages: Pages that don’t have internal links that direct to them (orphan pages) can be hard to get to. A sitemap ensures bots can still discover them. Still, internal linking remains necessary to pass authority.
  • Provides metadata: The additional data you include in a sitemap helps crawlers better understand, crawl, and index your content. For example, if they notice a new date in <lastmod>, bots will know to recrawl it. 
  • Supports multiregional sites: If your website serves multiple languages or regions, hreflang annotations in your sitemap help search engines display the correct version based on the visitor's location.
  • Helps with specialized search: You can create sitemap extensions for specific content, such as videos, images, and news. These sitemaps and their metadata help bots index and display content in specialized results pages.

Simple websites with fewer than 500 pages and a comprehensive linking system can function without a sitemap. However, large websites with complex navigation, limited linking, and frequent updates need a sitemap to make key content reachable.

Sitemap.xml and Robots.txt

A sitemap works in tandem with your robots.txt file, which instructs bots on which content they should and shouldn’t access. It’s a standard practice to link to your sitemap within the robots.txt file. Not having one or either of these files could result in server overload as multiple bots try to crawl your entire site at once.

When both files are configured correctly, search engines and AI crawlers can index your content efficiently and surface updates faster. They’re part of baseline infrastructure. Without them, even strong content can get lost in the crawl.

What Does an XML Sitemap Look Like?

XML sitemaps use Extensible Markup Language (XML) and conform to the standardized schema defined by the Sitemaps 0.90 protocol. This format is supported by all major search engines, such as Google and Yahoo. 

As per the protocol, XML sitemap files must be under 50 MB and contain no more than 50,000 URLs. Websites that exceed these limits require more than one sitemap.

sitemap-example

Namespace Declarations

As you can see in the above screenshot, an XML sitemap starts with the technical specifications:

<?xml version="1.0" encoding="UTF-8"?>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

In this case, the specifications define the sitemap version (1.0), encoding system (UTF-8), and namespace declaration (xmlns), which specifies the protocol. 

Additional declarations can signal the presence of media content or alternate language versions, which we’ll cover later.

Other Elements and Tags in an XML Sitemap

Sitemaps use tags to label and organize data, some of which are mandatory as per the 0.90 protocol:

Tag/Element* What It Does Is It Mandatory?
<?xml> Precedes the version and encoding system ✔️
xmlns Declares the namespace (protocol standard) ✔️
<urlset> Surrounds the whole sitemap file ✔️
<url> Surrounds URL entries ✔️
<loc> Specifies the full URL of the page you want search engines to crawl ✔️
<priority> Suggests the importance of a page from 0.0 to 1.0 in relation to other pages on the site
<lastmod> Indicates when the last meaningful update of the page occurred in the YYYY-MM-DD format
<changefreq> Estimates at the frequency of updates for a page (daily, weekly, or monthly)
*Keep in mind that some crawlers may not follow all tags, or may treat them as suggestions. For example, Googlebot ignores the <priority> and <changefreq> tags entirely.

Each tag has an opening version, which comes before the data, and a closing version that comes afterward and contains a slash (/). Files start with a <urlset> tag and end with a </urlset> tag after all the URLs and attributes have been listed. Similarly, URL entities begin and end with <url> and </url>, respectively.

Here’s an example of a full URL entry for Omnius’s homepage:

url-entry-example

XML sitemaps also have to use entity-escape codes (UTF-8) for content between tags. For example, < should become &lt; and > should become &gt; so that parsers can easily differentiate between tags and content.

Sitemap Extensions for Regional Content

If you have alternative versions of pages aimed at different regions or languages, include them as extensions in your sitemap. 

To do so, you first need to add a namespace declaration at the beginning of a sitemap and after the main protocol tag. The W3C namespace is standard across the web:

namespace-example

XML Tags for Regional Content

The next step is to add specific namespace tags, hreflang tags, and language/country codes in the appropriate pages’ URL entries. These should come after the mandatory and optional XML tags. Here’s what that might look like:

specific-tags-examples

In this example, we have a Dutch version of the page for visitors in the Netherlands and another one for Dutch speakers in Belgium. 

Here are complete lists of ISO 639-1 language codes and ISO 3166-1 alpha-2 country codes to use in your extensions.

Sitemap Extensions for Specialized Content

You can indicate images, videos, and news on your website and provide metadata for them in your sitemap. 

Start by adding the relevant namespace declarations at the top of your sitemap. A sitemap with all three types of content may have the following:

extensions-example

Although the above declarations were created by Google, they are universally recognized by all major search engines.

XML Tags for Specialized Content

You can use the following tags to define the specialized content on your pages:

Content Type XML Tags What It Does
Images <image:image> Surrounds all image data
<image:loc> Surrounds image URL entities
<image:license> Specifies the URL to the image license
<image:caption>,
<image:geo_location>,
<image:title>
Defines the image caption, location, and title
Videos <video:video> Surrounds all video data
<video:content_loc> Surrounds video URL entities
<video:thumbnail_loc> Specifies the URL of the video’s thumbnail
<video:player_loc> Specifies the URL to the video player
<video:tag> Defines tags associated with the video
<video:title>,
<video:duration>,
<video:publication_date>
Defines the video title, duration, and initial publishing date
News <news:news> Surrounds all news data
<news:publication> Surrounds news entries
<news:name>,
<news:language>,
<news:genre>
Specifies the publication name, date, language, and genre
<news:publication_date> Defines the publication date in the YYYY-MM-DD format

Place these tags and data within URL entries in your sitemap. Here’s an example entry for a page containing a video:

tags-example

The extension tags are placed at the end of the URL entry here, but they can appear in any order within a URL entry, as long as they come after the mandatory and optional page tags. This applies to both specialized content and alternate regional pages.

If your website is large, supports 10+ languages, or features a lot of specialized content, you risk exceeding the 50 MB or 50,000 URL limit. In that case, you may need to create multiple specific sitemaps and link them using a sitemap index file.

What Is a Sitemap Index?

A sitemap index is a file that references multiple sitemaps, similar to a table of contents. If you pull up a sitemap for a complex website, such as Google’s or Apple’s, you’ll run into a sitemap index instead of a sitemap:

sitemap-index-example

An index rests on the same 0.9 protocol as sitemaps and includes similar XML tags:

  • <sitemapindex>: Surrounds the entire sitemap index
  • <sitemap>: Surrounds sitemap entries
  • <loc>: Specifies sitemap URLs
  • <lastmod>: Specifies when the sitemap was last updated

How To Create an XML Sitemap 

The first step is to select the URLs you want to display in search results. If some of your content is available under multiple URLs, choose one URL instead of including them all.

There are several ways to generate your XML sitemap:

  1. Via your CMS
  2. Via third-party tools
  3. Manually

CMS and Plugins

Some CMS platforms, such as WordPress and Shopify, automatically generate a sitemap. To check whether you already have one, add /sitemap.xml at the end of your full website URL. 

If your platform doesn’t generate a sitemap or limits customization, try adding plugins and modules, such as Yoast or XML Sitemap Generator for Google.

Your CMS may also generate an RSS, mRSS, or Atom 1.0 sitemap, which is focused on the latest updates on your website. This can be a great addition to your XML sitemap, especially for blogs and news sections.

Third-Party Tools

Many tools exist to help you generate an XML sitemap and some even let you do so for free. For example, Screaming Frog and SEOptimer offer free plans with limited features. There are also several free tools, such as the Semrush Sitemap Generator

These tools vary in terms of complexity, customization options, and auditing ability, so evaluate them carefully to select the best one for your needs and budget. For example, if you have a small website, a free and simple tool combined with Google Search Console for validation works well. But for larger websites, it may be worth investing in a complex tool with built-in audits and automatic updates.

Manual Method

Creating your XML sitemap manually only makes sense if your website has up to a few dozen URLs and you need full control over its layout. 

To make a sitemap manually, you need a simple text editor like Windows Notepad. If you go this route, make sure to follow the standard format and include all the mandatory XML tags. Once you’re done, save the file as sitemap.xml.

If your website has no more than a few pages, you can create a text sitemap instead of an XML sitemap. This variant doesn’t require you to use tags or namespaces. Instead, you only need to list the URLs and save the sitemap as a .txt file.

Validating and Uploading Your XML Sitemap

Validate your sitemap before publishing to catch problems like formatting errors, broken URLs, and missing tags.

If you created your file manually or via a tool that doesn't have the validation option, upload it to Google Search Console’s Sitemaps report—it’s free. The report flags errors immediately, so you can fix them before they block indexing.

Aim to have as many of your indexable URLs indexed by Google. For a large website, a 95–80% score is still considered solid, while anything lower than 70% warrants thorough investigation and possibly restructuring.

Once Google greenlights your file, add it to the root directory of your website and include it at the end of your robots.txt file as follows:

Sitemap: https://examplesite.com/sitemap.xml

Here’s a quick to-do list to use when creating your sitemap:

  • Follow the formatting precisely.
  • Include all mandatory elements.
  • Close your tags properly.
  • Use entity-escape codes.
  • Avoid duplicate and broken URLs.
  • Use full URLs (with https or http://…).
  • Don’t use redirecting URLs.
  • Validate your sitemap.
  • Reference the file in robots.txt.
  • Place the file in your root directory.
  • Split the file if it’s too large.

The work is not done once your sitemap is ready. You need to update it regularly so it reflects any changes on your website, then upload it to Google again. Some CMSs and third-party tools will audit, update, and upload your sitemap automatically through an API.

Conclusion

An XML sitemap is a small file with an outsized impact on your content’s visibility. A well-structured sitemap speeds up indexing and gives bots the metadata they need to understand your website.

Getting your sitemap right isn't difficult, but a sitemap alone won't move your rankings. It's only one component of a larger technical and strategic foundation.

If you need help building the rest of that foundation, reach out to Omnius. We optimize B2B websites for growth across search engines, handling everything from technical SEO to content execution.

Frequently Asked Questions

Are sitemaps still relevant?

Yes, sitemaps are still crucial for SEO in 2026. Search engine bots check your sitemap to better understand your website before crawling it. Without a sitemap, crawling could be inefficient and take longer, harming your visibility. This is especially problematic for complex websites with frequent updates.

Do XML sitemaps matter for AI search?

Yes, XML sitemaps serve both search engine and AI crawlers, including those for LLMs and AI overviews. Sitemaps help AI bots identify and structure content, which enables faster indexing and better fact retrieval.

Do I need a sitemap for a small website? 

Technically, no, you don’t need a sitemap for a website under 500 pages, especially if it’s sufficiently linked and doesn’t have frequent updates or a lot of media. Bots can easily crawl websites with simple structures and content. 

Still, it’s recommended to have one anyway. Doing so will facilitate the indexing of new content and help you discover any crawl issues. 

If you have only a few webpages, you can create a simple text sitemap without XML tags, which should take only minutes.

Can ChatGPT create a sitemap?

Yes, ChatGPT and other AI chatbots can generate sitemaps for smaller websites, but it’s important to double-check everything and validate the file before publishing.

We broke the “standard agency” model, and built it differently.

Learn how we integrate deep into SaaS & Fintech companies to make the growth predictable.

Vertical Black Line
/ No. 1 LinkedIn™ content-focused SaaS tool
With Omnius, we saw immediate results - 64% higher conversion on a new website and 110% organic growth in 6 months. So, if you want an agency that understands startups, do yourself a favour and talk to them.”
Ivana Todorovic
co-founder & CEO
Ivana Todorovic
Vertical Black Line
/ Berlin-based early-stage VC fund
“Omnius is one of the most high-quality, reliable, and trustworthy SEO agencies in Europe, specifically focused on B2B SaaS & Fintech startups.”
Polina Alexandrova
INVESTOR
Polina Profile Picture
Vertical Black Line
/ EU's most visited AI platform; G2's Top 10 AI products
“Omnius is bringing in great ideas from their view of the SaaS world.”
Dominik Lambersy
Co-founder & CEO
Dominik Profile Picture
Vertical Black Line
/ Deloitte UK Technology Fast 50 fintech company
"Omnius completely owns the project - taking control & monitoring performance. The speed at which they deliver is insane – I honestly don’t know if they have 100 people working around the clock."
Sergei Fedorov
FORMATIONS PO
Group 1000002597
Vertical Black Line
/ One of the leading EOR platforms with 150,000+ users globally
"We truly see Omnius as an extension of our in-house team. As a result of the collaboration, we've seen clearer strategy, better SEO performance overall, and notable AIO improvements.
Barbara Borko
SEO MANAGER
Barbara Borko Native Teams
left arrow black
right arrow black
BigCommerce Black Logo
Payoneer Black Logo
worldfirst logo
text.cortex
Meniga
Anna
apexanalytix
Zencoder
Native Teams
onetrance
GlobalAppTesting Black Logo
Signify
rready
AuthoredUp Black Logo
glorify

Monthly Growth OpenLetter.

Learn how to scale user acquisition without scaling costs from our findings. We spent years exploring, so you don't have to.

Your submission has been received!              
Oops! Something went wrong while submitting the form.

Related articles.

White Omnius

AI-native SEO Agency, maximizing the growth probability on ChatGPT Google Claude Gemini Perplexity

Omnius is a B2B SEO & GEO agency; partnering up exclusively with SaaS, Fintech & AI companies. The result? Compounding growth made through organic positioning everywhere people search for information, including both Google & LLM search engines.

Our work is referenced by the leading media, venture funds & startup organizations
Ycombinator
YCombinator
Reuters
Reuters
Bloomberg
Bloomberg
Iab
Intuit Mailchimp
Speedinvest
Speedinvest
entrepreneur-first
Entrepreneur First