Skip to content
AnswerWell geo Documentation

Research · 8 min read · Answerwell

XML Sitemap: Formats, Limits, Submission and Extensions

How to build and submit XML sitemaps: protocol formats, 50,000 URL limits, robots.txt lines, Search Console, and image or news extensions.

This page summarizes how to build and submit sitemaps according to Google Search documentation on sitemaps and the Sitemaps protocol. A sitemap is a file where you list URLs you care about—often with metadata such as last modification time—so crawlers can discover and process those URLs more efficiently. It is a hint, not a guarantee of crawling or indexing.

Sitemap protocol: what the file does and when you need one

Section titled “Sitemap protocol: what the file does and when you need one”

A sitemap tells crawlers which pages and files on your site matter to you and can carry extra detail about videos, images, news, or localized versions.

A sitemap is a file where you provide information about the pages, videos, and other files on your site, and the relationships between them. Search engines like Google read this file to crawl your site more efficiently.

— Google, Learn about sitemaps

The sitemaps.org project describes the same idea at the protocol level: crawlers usually find pages via links, and sitemaps supplement that with a complete URL list and optional metadata. Using the protocol does not guarantee inclusion in search results.

If internal links already expose every important page, you may not need a sitemap—Google cites sites with roughly 500 pages or fewer that are well linked. You are more likely to benefit when the site is large, new with few inbound links, has rich media or news you want in Search, you just launched, or you performed a site move and must update URLs in sitemaps. For many URLs at once, submitting a sitemap is the practical bulk-discovery path.

Sitemap formats: XML, RSS or Atom, and text files

Section titled “Sitemap formats: XML, RSS or Atom, and text files”

Google supports the formats defined by the sitemaps protocol and has no preference among them; pick what fits your stack. See Build and submit a sitemap for the full comparison.

Format Best for Main limitation
XML sitemap Most sites; images, video, news, hreflang via extensions Can be heavy to maintain on very large or fast-changing sites
RSS, mRSS, Atom 1.0 Sites that already publish feeds Often only recent URLs; limited media metadata vs XML
Text sitemap (.txt) Simple URL lists URLs only—no image, news, or video sitemap metadata

XML is the most versatile: Google documents a minimal example in Build and submit a sitemap. Text files are one absolute URL per line, UTF-8, with nothing else in the file—see the Sitemaps protocol text file rules.

For small sites (under a few dozen URLs), manual creation is reasonable; larger sites should use CMS or automated generation from the site database, as described in Build and submit a sitemap.

Sitemap size limits and sitemap index files

Section titled “Sitemap size limits and sitemap index files”

Protocol and Google align on hard caps per sitemap file.

Sitemaps should be no larger than 50MB (52,428,800 bytes) and can contain a maximum of 50,000 URLs.

— sitemaps.org, Sitemaps XML format

Google repeats the same 50MB uncompressed / 50,000 URL limits in Build and submit a sitemap. Split into multiple sitemaps when you exceed either bound, then reference them from a sitemap index file. An index may list up to 50,000 child sitemaps and is also capped at 50MB; you may gzip compress files, but the uncompressed payload must still respect the limit (FAQ recommends gzip).

Manage your sitemaps with a sitemap index file adds Google-specific index rules: referenced sitemaps must live on the same site as the index unless you use cross-site submission; child sitemaps must sit in the same directory as the index or deeper in the hierarchy. You can submit up to 500 sitemap index files per site in Search Console.

For huge sites, the FAQ notes you can put frequently changing URLs in a few sitemaps and use lastmod on index entries so crawlers fetch only changed parts.

URL rules, encoding, and optional XML tags

Section titled “URL rules, encoding, and optional XML tags”

Location and scope. Unless you submit through Search Console, a sitemap only covers URL descendants of its directory; Google recommends hosting sitemaps at the site root so they can cover the whole site (Build and submit a sitemap). The protocol requires every URL in one sitemap to share the same host (Sitemaps XML format).

Absolute URLs. Use fully qualified URLs. Google crawls listed URLs as written.

Use fully-qualified, absolute URLs in your sitemaps. Google will attempt to crawl your URLs exactly as listed.

— Google, Build and submit a sitemap

The FAQ requires the protocol in each URL and a trailing slash when the server expects it. List only one HTTP/HTTPS variant per page; duplicates can hurt crawling.

Encoding and escaping. Files must be UTF-8 (FAQ). XML values, including URLs, need entity escaping (& → &, etc.) per Sitemaps XML format.

What to include. List canonical URLs you want in search results, not every duplicate of the same content (Build and submit a sitemap). For datasets, Google suggests sitemaps plus sameAs on canonical landing pages (Dataset structured data).

lastmod, changefreq, priority. Google uses lastmod when it is consistently accurate and reflects meaningful page changes—not cosmetic updates like a copyright year (Build and submit a sitemap). Use W3C Datetime for timestamps (FAQ).

Google ignores priority and changefreq in XML sitemaps (Build and submit a sitemap). The protocol still treats priority as a within-site hint, not a ranking signal (FAQ). URL order in the file does not matter to Google (Build and submit a sitemap).

Submit sitemap to Search Console, robots.txt, and APIs

Section titled “Submit sitemap to Search Console, robots.txt, and APIs”

After the file is on your server, expose it to crawlers using one or more of these paths from Build and submit a sitemap:

  1. Submit in Google Search Console via the Sitemaps report so you see when Googlebot fetched the file and any processing errors.

  2. Use the Search Console API to submit programmatically (same page).

  3. Add a Sitemap: line in robots.txt with the full URL; Google discovers it on the next robots.txt crawl. You may list multiple sitemaps with no stated limit.

robots.txt Sitemap directive (Google, Bing, protocol). Major engines support the field defined at sitemaps.org:

Google, Bing, and other major search engines support the sitemap field in robots.txt, as defined by sitemaps.org.

— Google, How Google interprets the robots.txt specification

The value must be a fully qualified absolute URL—not a relative path. Lighthouse invalid robots.txt guidance shows sitemap: /sitemap-file.xml as wrong and sitemap: https://example.com/sitemap-file.xml as correct. Bing Webmaster Help on sitemaps documents the same Sitemap: line pattern.

The sitemap URL does not have to live on the same host as robots.txt (Google robots.txt spec), which matters for cross-hosted sitemap files.

The Sitemaps protocol also allows notifying engines via their submission UI or an HTTP ping to <searchengine_URL>/ping?sitemap=… (URL-encode the sitemap parameter). For a sitemap index, one ping for the index is enough.

If you use Atom or RSS as a sitemap, Google notes you can use WebSub to broadcast updates.

Cross-site sitemap submission for multiple domains

Section titled “Cross-site sitemap submission for multiple domains”

When one host serves sitemap files for several verified properties, follow Build and submit a sitemap:

  • Search Console path: Verify every site, build sitemap(s) or a sitemap index covering all target URLs, submit the index or individual files in Search Console.
  • robots.txt path: One sitemap file per site containing only that host’s URLs; upload all files to a hub you control; on each site’s robots.txt, point to that site’s sitemap URL on the hub (example in Google’s cross-submission section).

The protocol cross-submit rules explain why each target sitemap must contain URLs only for the host whose robots.txt references it—otherwise you get cross-submission errors.

Sitemap extensions: image, news, video, and hreflang

Section titled “Sitemap extensions: image, news, video, and hreflang”

XML sitemaps can declare extra namespaces on urlset for specialized content. How to combine sitemap extensions lists Google-supported namespaces: image (http://www.google.com/schemas/sitemap-image/1.1), news, video, and xhtml for hreflang. After declaring namespaces, add extension tags inside each url entry; order after loc does not matter, but combined files grow quickly—watch the 50MB cap.

Image sitemaps help Google find images, including JS-loaded ones (Image sitemaps). Each url may hold up to 1,000 image:image entries; image:loc may point off-domain (e.g. a CDN) if you verify both domains in Search Console and do not block crawling in robots.txt (Google image SEO best practices).

News sitemaps should list articles from roughly the last two days; remove stale URLs or strip news:news metadata (News sitemaps). An temporarily empty news sitemap can trigger an “Empty Sitemap” warning in Search Console without harming Search if intentional.

For video, see Video sitemaps and alternatives. Combine sitemap extensions shows news, video, and hreflang on one URL record.

  • Relative URLs in the sitemap or in robots.txt Sitemap: lines.
  • Mixing http and https duplicates for the same page.
  • Exceeding 50,000 URLs or 50MB per file without a sitemap index.
  • Inaccurate lastmod (e.g. “now” on every build) so crawlers cannot trust change signals.
  • Listing non-canonical or duplicate URLs instead of the preferred URL.
  • Cross-hosted sitemaps without per-site robots.txt references or mismatched hosts inside each file.
  • Blocking crawlers from URLs or CDN hosts you still list in an image sitemap.
  1. Open the sitemap URL in a browser or fetch it with curl and confirm HTTP 200, UTF-8, and valid XML (or plain URLs for .txt).
  2. Confirm every loc is absolute, uses one canonical scheme/host, and matches pages you want indexed.
  3. In Google Search Console, open the Sitemaps report, verify the submitted URL, and review status and errors; use the troubleshooting guidance linked from Build and submit a sitemap if needed.
  4. Fetch robots.txt and confirm each Sitemap: line uses a full https://… URL per Google’s robots.txt spec; repeat in Bing Webmaster Tools if you rely on Bing.
  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about.