In this guide
What an XML sitemap is
An XML sitemap is a file that lists the URLs on a site that you want to appear in search results. Each entry holds the full page address and, optionally, the date of its last significant change. The file usually lives at example.com/sitemap.xml.
According to Google Search Central, a sitemap helps search engines discover URLs but does not ensure every item will be crawled and indexed. It points the way. The decision to add each page to the index stays with Google.
That is why the sitemap is one piece of the technical foundation, next to robots.txt, canonicals, and internal links. On its own, it does not fix weak or blocked pages. That is how we treat it in our SEO service for businesses.
Does your site need one?
Not every site does. Google says you might not need a sitemap if your site is small, with about 500 pages or fewer that you want in search results, if all important pages are linked internally, and if you do not have many videos, images, or news pages that need to appear in search.
It matters most in four situations:
- large sites, where new or updated pages can be overlooked;
- new sites with few links from other websites;
- sites with pages that get few internal links, such as products deep in categories;
- sites with a lot of video, image, or news content.
Even for small sites, an automatically generated sitemap costs little to maintain and makes monitoring in Search Console easier.
How to create the file
Minimum structure
The format follows the sitemaps.org protocol. The file must be UTF-8 encoded and use absolute URLs, with protocol and domain:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/services/consulting/</loc>
<lastmod>2026-10-02</lastmod>
</url>
</urlset>
What goes in and what stays out
Include the canonical URLs you want in Google. When the same content is available at more than one address, Google says to choose the preferred URL and list only that one. Leave out noindex pages, redirecting pages, error pages, and parameter versions.
Optional fields
Many tutorials still ask for priority and changefreq. Google's documentation says it ignores both. The useful field is lastmod, which Google uses if the date is consistently and verifiably accurate. It should reflect the page's last significant update. A footer change does not count.
Limits and sitemap index files
Each file holds up to 50,000 URLs or 50 MB uncompressed. Beyond that, split it into several sitemaps and create an index file that points to them. An index file can list up to 50,000 sitemaps, and Search Console accepts up to 500 index files per site, according to the guide on large sitemaps.
Manual or automatic
For a small brochure site whose pages rarely change, a hand-written file works. For blogs, stores, and sites that publish often, the sitemap should be generated by the site's own system or a plugin, so new pages are added and removed pages drop out without anyone having to remember.
How to submit and monitor it
Google accepts three ways to submit:
- Search Console sitemaps report: enter the file address and submit. This is the method that shows read status and the number of discovered URLs.
- A line in robots.txt: add
Sitemap: https://example.com/sitemap.xml. There is no limit on the number of Sitemap lines. - Search Console API: useful when sitemaps are generated and submitted automatically.
The old ping method no longer works. Google announced the endpoint's retirement in June 2023.
After submitting, monitor the sitemaps report and the page indexing report. If many submitted URLs show as discovered but not indexed, the problem is probably not the sitemap. It is the quality, duplication, or accessibility of those pages.
Common mistakes
- Listing blocked or noindex pages: the file draws attention to URLs the site itself does not want indexed.
- A sitemap generated once and forgotten: new pages are missing and removed pages are still listed.
- Today's date as lastmod on every URL: the date stops matching reality and loses its value.
- URLs that differ from the canonical: the sitemap lists one version and the page declares another as the main one.
- A file over the limits: more than 50,000 URLs or 50 MB in a single sitemap.
How ROMA applies this
In ROMA's SEO method, the sitemap belongs to step 3, Foundation & Core Architecture, together with robots.txt, canonicals, and site architecture. The URL list comes from the earlier steps: the Opportunity Assessment shows which pages exist and which are missing from the index, and Demand Mapping defines which of them lead to inquiries or sales. In step 5, the Search Console sitemaps report is part of the monthly review to check whether submitted pages are being indexed.
XML sitemap FAQ
Does a sitemap make Google index my pages?
Not necessarily. Google says a sitemap helps it discover URLs but does not ensure every item will be crawled and indexed. Google itself decides on indexing, based on the quality and usefulness of each page.
Do I need priority and changefreq?
Not for Google. Google's documentation says it ignores priority and changefreq values. The field it uses is lastmod, as long as the date is consistent and reflects real changes.
Where should the sitemap live?
Google recommends the site root, such as example.com/sitemap.xml. A sitemap outside the root only affects pages in its own folder, unless you submit it through Search Console.
Can I still ping Google about a sitemap?
No. Google retired the sitemaps ping endpoint, announced in June 2023. Today you submit through the Search Console sitemaps report, the Search Console API, or a Sitemap line in robots.txt.
Can I include noindex pages in the sitemap?
It is not advisable. The sitemap should list the URLs you want in Google. Including a noindex page sends two opposite signals about the same URL.
Sources
- Learn about sitemaps, Google Search Central.
- Build and submit a sitemap, Google Search Central.
- Manage your sitemaps with sitemap index files, Google Search Central.
- Sitemaps ping endpoint is going away, Google Search Central Blog, June 26, 2023.