Loading...

Skip to content
MemonaIQ
ToolsLearnCompany
Sign in
ToolsLearnCompanyBrowse all tools
Knowledge Center
In this topic
Technical SEO
How to find broken links on your websiteTechnical SEO checklist: crawl, index and page basicsWebsite crawling explained: how crawlers find pagesXML sitemaps: format, limits and what to includerobots.txt rules: syntax, matching and common mistakes
A-Z glossary
HomeKnowledgeTechnical SEO
Technical SEO•3 min read•beginner

XML sitemaps: format, limits and what to include

What an XML sitemap does and doesn't do, its format and size limits, how sitemap index files work, where to declare it, and which URLs belong in it.

What an XML sitemap is and is not

An XML sitemap is a file that lists the URLs on your site you want search engines to crawl, with an optional date each page last changed. It helps crawlers discover pages, especially new pages, pages with few internal links and pages on large sites.

Search engines treat a sitemap as a hint. Listing a page doesn't force it into the index or raise its ranking. Pages still need internal links so visitors and crawlers can reach them from the rest of the site.

The sitemap format

The format comes from the Sitemaps protocol published at sitemaps.org, which Google, Bing and other search engines support. The file is UTF-8 encoded XML with a urlset root element in the protocol namespace.

Each page is a url element with a required loc, the page's absolute URL including https://. The optional lastmod gives the date of the last significant change, as a date or a full timestamp in W3C Datetime format.

The protocol also defines changefreq and priority, but Google ignores both. Google uses lastmod only when it is consistently accurate, so change it when the content changes, not on every build. Escape special characters in URLs as XML entities, such as & for an ampersand.

sitemap.xml
xml
<?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-20</lastmod>
  </url>
  <url>
    <loc>https://www.example.com/guides/sitemaps</loc>
    <lastmod>2026-09-02T14:30:00+00:00</lastmod>
  </url>
</urlset>

Size limits and sitemap index files

Each sitemap file can list up to 50,000 URLs and must be no larger than 50 MB uncompressed. You can gzip a sitemap to save bandwidth, but the limit still applies to the uncompressed size.

A larger site splits its URLs across several sitemaps, often by section or content type, and lists them in a sitemap index file. The index uses sitemapindex and sitemap elements, each with a loc and an optional lastmod. Under the protocol, one index can list up to 50,000 sitemaps.

Submitting the index is enough, since search engines read the sitemaps it lists.

sitemap-index.xml
xml
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://www.example.com/sitemap-pages.xml</loc>
    <lastmod>2026-10-20</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://www.example.com/sitemap-posts.xml.gz</loc>
  </sitemap>
</sitemapindex>

Where to declare your sitemap

Add a Sitemap line with the full URL to robots.txt, for example Sitemap: https://www.example.com/sitemap.xml. The line can go anywhere in the file, applies to all crawlers, and can be repeated for several sitemaps.

Also submit the sitemap in Google Search Console's Sitemaps report and in Bing Webmaster Tools. Those reports show when the file was last read and which URLs had problems. Google retired its sitemap ping endpoint in 2023, so don't rely on pinging.

Host sitemaps at the site root. Unless you submit a sitemap through Search Console, Google applies it only to URLs inside the folder that contains it.

Which URLs to include and which to leave out

List the URLs you want in search results, in exactly the form you use in canonical links: the same protocol, hostname and trailing-slash style. Generate the sitemap from your CMS or build process so it changes when pages are added or removed.

Leave out URLs that send a conflicting signal:

  • Redirecting URLs, and URLs that return 404, 410 or a server error
  • Pages marked noindex, and pages blocked in robots.txt
  • Duplicates whose canonical points to another URL, including sort, filter and tracking parameters
  • Internal search results, login pages, carts and checkout steps
  • Staging and test hosts
Previous guide
Website crawling explained: how crawlers find pages
Next guide
robots.txt rules: syntax, matching and common mistakes
MemonaIQ tools

Try it on your own input

Check what this guide describes against your own URL, domain, code or file.

URL Intelligence Platform

Paste the URLs from your sitemap to confirm each one returns 200 without redirecting. Requires sign-in.

Open tool
Website Launch Readiness Checker

Confirm before launch that your sitemap loads, along with robots.txt, noindex and metadata checks on the homepage. Requires sign-in.

Open tool

References

  • Google Search Central: Build and submit a sitemap
  • Google Search Central: Learn about sitemaps

On this page

What an XML sitemap is and is notThe sitemap formatSize limits and sitemap index filesWhere to declare your sitemapWhich URLs to include and which to leave out
Updated:2026-10-25
Format:Technical Guide
Related tool
URL Intelligence Platform

Paste the URLs from your sitemap to confirm each one returns 200 without redirecting. Requires sign-in.

Open tool
MemonaIQ

Focused tools for everyday digital work.

  • 18 focused tools
  • 9 run in your browser
Browse all tools Get help

Featured tools

URL Intelligence PlatformImage CompressorInvoice StudioDNS LookupAI Token Counter

Explore

All toolsKnowledge CenterGuidesResourcesCompany

Support

HelpContactSecurity

Legal

PrivacyTermsCookies

© 2026 MemonaIQ. Made in Colombo.

Back to top

MemonaIQ