A search engine will not necessarily discover every page on your site on its own. An XML sitemap makes that discovery easier by handing search engines a machine-readable list of the addresses on your site. This guide explains what a sitemap does, how it is structured, and what to watch for in practice.

Part of a series: this article belongs to our guide to SEO-friendly news software.

What Is an XML Sitemap?

An XML sitemap is a text file, usually published as sitemap.xml, that lists the URLs on your site along with hints about each one, such as when it was last changed. Search engine bots read this file to see which pages exist and when they were updated. A sitemap is not a ranking tool; it is a roadmap that streamlines discovery and crawling.

Having a sitemap does not guarantee that every listed address will be indexed. The search engine still makes its own judgment; the file is simply a strong signal about which pages you consider important.

Why You Need a Sitemap

On a small, well-interlinked site, a search engine can already find your pages by following links. But a sitemap makes a clear difference in cases like these:

  • The site has many pages, and some are only weakly connected through internal links.
  • You publish content frequently and quickly, as news sites do, and need new pages to be noticed fast.
  • You are a new site with few external links pointing to you.
  • You have rich media such as images or video that you want reported separately.

In news publishing, speed matters; anything that accelerates content discovery helps new stories become visible sooner. To keep page speed high at the same time, it is also worth paying attention to caching.

Sitemap Structure and Tags

A sitemap consists of a root <urlset> element containing one <url> block per address. The simplest valid example looks like this:

xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/news/sample-headline</loc>
    <lastmod>2026-09-28</lastmod>
  </url>
  <url>
    <loc>https://example.com/category/politics</loc>
    <lastmod>2026-09-27</lastmod>
  </url>
</urlset>

Only <loc> is required; the other tags are optional hints. Here is what each one means:

TagRequired?What it does
locYesThe full, absolute address of the page, including the protocol.
lastmodNoThe date the page was last modified. Valuable when kept accurate.
changefreqNoA hint about how often the content changes; search engines do not treat it as binding.
priorityNoRelative importance within the site (0.0-1.0). Its effect is limited and it does not set rankings.

Sitemap Types and the Index File

Instead of one giant file, large sites use several sitemaps, each covering a section, and gather them under a sitemap index. Common types include:

  • Standard URL sitemap: lists ordinary HTML pages.
  • Image sitemap: reports important images on your pages separately.
  • Video sitemap: provides metadata about video content, such as duration and description.
  • News sitemap: a separate format for Google News that covers only content from the last couple of days.
  • Sitemap index: a top-level file that points to your other sitemap files.

For news sites, keeping a news sitemap alongside the standard one lets recent content be presented separately and with priority. Using the two structures so they complement each other is a common approach.

Creating and Submitting a Sitemap

A sitemap is usually generated automatically by your content management system or publishing software; the file updates itself whenever a new page is added. For a static site, it can be produced at build time instead. Maintaining one by hand only makes sense for very small sites.

Declaring it in robots.txt

You can announce your sitemap's address to every search engine automatically by adding it to your robots.txt file:

text
Sitemap: https://example.com/sitemap.xml

Submitting through search consoles

Tools such as Google Search Console and Bing Webmaster Tools let you submit your sitemap directly and monitor its processing status, the number of URLs found, and any errors. To keep those addresses consistent, it helps to establish a solid SEO-friendly URL structure first.

Common Mistakes

  • Listing pages that carry a noindex tag or are blocked in robots.txt (a contradictory signal).
  • Leaving redirected (301/302) or erroring (404/500) addresses in the list.
  • Using relative addresses; <loc> must always be an absolute, full URL.
  • Bumping lastmod to the current date every time even when the content has not changed, which undermines the date's credibility.
  • Building a single file that exceeds the 50,000-URL or 50 MB limit instead of moving to an index structure.

Frequently Asked Questions

Will a sitemap raise my rankings?

Not directly. A sitemap eases discovery and crawling, but a page's ranking is determined by content quality, relevance, and other signals. Content that is discovered faster can gain an indirect advantage.

Are an HTML sitemap and an XML sitemap the same thing?

No. An HTML sitemap is a page built for visitors to navigate; an XML sitemap is a machine-readable file for search engines. The two serve different purposes and can be used together.

How often should I update the sitemap?

Ideally it should update automatically as content changes. On sites that publish frequently, keeping that update close to real time helps new pages get noticed sooner.