XML Sitemaps: What to Include and How to Submit One

By Simon White ·

An XML sitemap is a file that lists the URLs on your site you want search engines to crawl and index, in a structured format they can read directly. Unlike an HTML sitemap for visitors, it is written for crawlers. It helps Google discover pages and notice changes, but it is a hint, not a guarantee of indexing.

Most content management systems generate a sitemap automatically, which is both good and bad. Good because you get one for free; bad because the default often lists pages you never wanted in search. This guide covers when you need a sitemap, the format, what belongs in it, and how to submit it. It is part of my technical SEO series.

Do I need a sitemap?

You probably do not strictly need one if your site is small and well linked, but there is little downside to having one. Google’s sitemaps overview describes when a sitemap helps and when it may not be needed.

You are more likely to need a sitemap ifYou may not need one if
The site is large, so some pages may not be linked from othersThe site is small: about 500 pages or fewer that you want in search
The site is new and has few external links pointing to itEvery important page can be reached by following links from the home page
You publish a lot of video, images or news contentYou have little video, image or news content you want to appear in search

My recommendation, which is a practical opinion rather than a Google rule: have one anyway. It costs nothing on most platforms, it gives you a sitemap filter in Search Console’s Page indexing report, and it shows you quickly when Google cannot fetch or parse your key URLs.

What format does an XML sitemap use?

An XML sitemap is a UTF-8 encoded XML file with a urlset element containing one url entry per page, each with a loc tag holding the full URL. Google’s build a sitemap guide sets out the rules:

  • **Formats accepted.** XML, RSS 2.0 or Atom 1.0 feeds, and plain text files with one URL per line. XML is the most flexible, supporting image, video, news and localized-version data. HTML sitemaps cannot be submitted.
  • **Size limits.** Each sitemap can hold up to 50,000 URLs or 50MB uncompressed, whichever comes first. You can gzip the file, but the limit applies to the uncompressed size.
  • **Sitemap index files.** Larger sites split URLs across several sitemaps and list them in a sitemap index file, which you submit instead.
  • **Absolute URLs.** Use full URLs, such as https://www.example.com/services/, not relative paths.
  • **Encoding.** The file must be UTF-8, and tag values must be entity-escaped.
  • **Location.** Google recommends the site root. A sitemap only covers its own directory and below unless you submit it through Search Console.

A minimal entry contains a loc tag with the page URL and, optionally, a lastmod tag with the date it last changed in a supported date format, such as 2026-11-20. That is all most sites need.

What about priority, changefreq and lastmod?

Google ignores priority and changefreq, according to the same guide, so do not spend time tuning them. Google uses lastmod only when it is consistently accurate. In a June 2023 post, Google said lastmod helps it schedule recrawls of known URLs, and that the date should reflect the last significant change to the main content, structured data or links, not a footer tweak or a copyright year. If your platform updates lastmod on every page every day, Google will learn to distrust it.

What should a sitemap include?

A sitemap should include only the canonical, indexable URLs you want to appear in search results. Google’s guide says to list canonical URLs, the versions you want shown in results. In practice, every URL in your sitemap should:

  • Return an HTTP 200 status, not a redirect or error.
  • Be the canonical version, matching the page’s own canonical tag.
  • Be indexable, with no noindex tag or header.
  • Not be blocked by robots.txt.
  • Use the same protocol and host as your live site, usually HTTPS and one consistent www or non-www version.

For international sites, XML sitemaps can also carry hreflang annotations, which is often easier to manage than adding them to every page template. Image and video sitemap extensions are useful if those assets matter for your search traffic.

What should you leave out of a sitemap?

Leave out any URL you would not want a searcher to land on. The usual offenders that default sitemaps include:

  • Redirected URLs and old addresses.
  • Pages with noindex, such as thank-you pages, login pages and internal search results.
  • Parameter, filter and sort variations.
  • Duplicate or alternate versions, such as print pages or non-canonical paths.
  • Tag, author or date archives that you do not want ranking.
  • Attachment or media pages that some CMS platforms create for every uploaded image.
  • 404 and soft 404 pages.
  • Staging or development URLs.

Leaving junk in the sitemap does not usually cause a penalty, but it sends mixed signals and dilutes what the file is telling Google. On big sites it also adds to wasted crawling, which my crawl budget guide covers.

How do I submit a sitemap?

Submit a sitemap in Google Search Console’s Sitemaps report, and reference it in robots.txt so other crawlers can find it too. Google’s Sitemaps report help page describes the steps:

  1. Make sure you have owner permission on the Search Console property. If you do not, list the sitemap in robots.txt instead.
  2. Publish the sitemap on your site, ideally at the root, for example https://www.example.com/sitemap.xml.
  3. Test that Google can fetch it by inspecting the sitemap URL with a live URL Inspection test and checking that Page fetch is successful.
  4. In the Sitemaps report, paste the sitemap URL into “Add a new sitemap” and click Submit.
  5. Check the status. “Success” means the sitemap was read and its URLs queued. “Has errors” means some entries could not be parsed. “Couldn’t fetch” means Google could not retrieve the file at all.

You can also add a line such as Sitemap: https://www.example.com/sitemap.xml to robots.txt. Multiple Sitemap lines are allowed. Google’s guide also lists the Search Console API as an option, and WebSub for RSS and Atom feeds.

One method to stop using: Google deprecated its sitemap “ping” endpoint in the June 2023 post, and said requests to it would return a 404 after six months. As of late 2026, Search Console and robots.txt are the supported routes. If Bing traffic matters to you, Bing Webmaster Tools has its own sitemap submission as well.

Removing a sitemap from the Search Console report does not make Google forget the URLs in it, according to the same help page. To stop Google visiting URLs, block, remove or noindex them.

How do I check whether my sitemap is working?

Check the Sitemaps report for status and discovered URL counts, then use the Page indexing report filtered to that sitemap to see how many listed URLs are indexed. If a large share of your sitemap URLs show as not indexed, that is a signal to look at what you are listing or at the quality of those pages. My pages not indexed guide explains the statuses you will see there.

FAQ

Do I need an XML sitemap?

Not always. Google says a small, well-linked site of about 500 pages or fewer may not need one. Large sites, new sites with few links, and media-heavy sites benefit most. Having one is still sensible for reporting.

What should an XML sitemap include?

Only canonical, indexable URLs that return a 200 status and that you want in search results. Leave out redirects, noindex pages, duplicates and parameter URLs.

How many URLs can a sitemap have?

Up to 50,000 URLs or 50MB uncompressed per file. Larger sites use several sitemaps listed in a sitemap index file.

Does submitting a sitemap guarantee indexing?

No. Google treats a sitemap as a hint about which URLs exist and matter. It still decides what to crawl and index.

If your sitemap is full of URLs you never meant to publish, or Search Console reports errors you cannot explain, get in touch. Sitemap cleanup is a standard part of my technical SEO work.

About the author

Simon White

Simon White is an SEO & AI consultant based in Encinitas, California, and co-founder of the digital marketing agency Local Blitz, which has served clients since 2009. A former electrical engineer with more than 15 years in SEO, he now helps businesses get found in Google and in AI answers through SEO, answer engine optimization (AEO) and generative engine optimization (GEO).

More about Simon →

Need help with this?

Get a clear SEO plan for your business

Simon has spent more than 15 years helping businesses rank and grow. Tell him where you are now and where you want to be.