Instructions

sitemap.xml — What It Is and Why You Need It

Редакція Spilno Agency | 12 May 2026 | 9 min read 11 views
sitemap.xml — What It Is and Why You Need It

A sitemap.xml is a file that tells search engines about the structure of your website: which pages exist, when they were last updated, and how important they are. It is one of the foundational technical SEO tools that speeds up indexing of new content and helps Google discover pages that have no direct internal links pointing to them.

A sitemap.xml is your website’s roadmap for search engine crawlers. A well-configured file reduces the time it takes for new pages to appear in search results.

xml sitemap

What Is a sitemap.xml

A sitemap.xml (or XML Sitemap) is a standardized XML file listing the URLs of a website. It follows the Sitemap 0.90 protocol, supported by Google, Bing, Yahoo, and other major search engines.

The file lives in the root directory of the site and is accessible at https://yoursite.com/sitemap.xml. Search engine crawlers periodically download this file to learn about new or updated pages.

Why You Need a sitemap.xml

Search engines discover pages in two ways: through internal links (crawling) and through the sitemap. Without a sitemap, a crawler may miss:

A sitemap.xml lets you explicitly inform Google about the existence and freshness of each page — especially important for large sites (500+ pages), brand-new sites without backlinks, and multilingual sites using hreflang.

Types of Sitemaps

Several types of sitemap files exist depending on content type:

Structure of a sitemap.xml File

The basic structure of an XML Sitemap looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/page/</loc>
    <lastmod>2026-05-01</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.8</priority>
  </url>
</urlset>

Sitemap Element Reference

The only required element in a sitemap is <loc>. Everything else is optional, but <lastmod> is genuinely used by Google to decide whether a page needs re-crawling.

How to Create a sitemap.xml

There are three main approaches to generating a sitemap:

1. CMS Plugins

2. Online Generators

3. Custom Scripts

For custom platforms, the sitemap is generated programmatically — via a server-side script (Python, PHP, Node.js) that queries the database and builds the XML file. The file is usually generated dynamically or regenerated when new content is published.

sitemap.xml in Google Search Console

Submitting your sitemap to Google Search Console (GSC) is a recommended step after creating the file. It allows you to:

Step-by-step: Submitting a sitemap to GSC

Submitting a sitemap does not guarantee immediate indexing — it is a request for Google to check the file. Actual crawling follows Google’s own schedule, influenced by domain authority and content freshness.

GSC Sitemap Status Meanings

Sitemap and Bing Webmaster Tools

Bing also supports sitemap.xml. To submit your file to Bing Webmaster Tools:

Alternatively, Bing discovers sitemaps automatically through the robots.txt Sitemap directive.

sitemap.xml for Different Site Types

E-commerce

For e-commerce sites, include category and product pages in the sitemap. Split into multiple files: one for categories, one for products, one for the blog. Exclude: cart, account, search results, and filter parameter pages.

Blog or News Site

Use a dedicated News Sitemap for fresh articles (within 48 hours). The main sitemap holds all articles. Always update <lastmod> when refreshing articles — it signals Google to re-crawl the content.

Corporate Site

Include all landing pages for services, case studies, About, and Contact pages. Exclude technical pages: admin login, order confirmation, 404 pages. Set homepage priority to 1.0, service pages to 0.8, blog to 0.6.

Multilingual Site

Multilingual sites need an hreflang sitemap — it explicitly tells Google which version of a page is for which language/region. This reduces the risk of cannibalization between language versions and improves visibility in each country’s local search results.

Best Practices and Common Mistakes

Do’s

Common Mistakes

sitemap.xml Checklist

GEO Optimization and Multilingual Sitemaps

For sites targeting multiple languages or countries, the sitemap plays a key role in GEO optimization. Google uses hreflang attributes to determine which page version to show to a specific user. These attributes can be delivered in three ways: via HTML <link rel=”alternate”> tags, HTTP headers, or directly in sitemap.xml.

Declaring hreflang in the sitemap is the cleanest approach for large sites where editing every page individually is impractical. It provides a centralized place to manage language relationships between pages.

Frequently Asked Questions

What is a sitemap.xml?

A sitemap.xml is an XML file listing a website’s URLs along with metadata: last modified date, change frequency, and priority. It helps search engine crawlers discover and index content faster.

Is a sitemap.xml required?

Technically no, but it significantly speeds up indexing of new pages and helps search engines find content without internal links. For large or frequently updated sites, it is practically essential.

How do I submit a sitemap to Google Search Console?

Open Google Search Console → select your property → click ‘Sitemaps’ in the left menu → enter your sitemap URL (e.g. sitemap.xml) → click ‘Submit’. Google will validate and start crawling.

How many URLs can a sitemap contain?

One sitemap.xml file can contain up to 50,000 URLs and must not exceed 50 MB. For larger sites, use a sitemap index file that links to multiple individual sitemap files.

Should I add my sitemap to robots.txt?

Yes, it is a recommended best practice. Add the line Sitemap: https://yoursite.com/sitemap.xml to your robots.txt file. This lets crawlers discover your sitemap automatically without needing a Search Console submission.

Need technical SEO help for your website? Spilno Agency provides site audits, sitemap setup, robots.txt configuration and structured data implementation.

Редакція Spilno Agency Spilno Agency All articles by author →
← Back to blog