Most sitemap advice describes the file in the abstract: which elements exist, what the limits are. That leaves the practical question unanswered. Open a real sitemap.xml and what should you actually see? Which lines are required, which are decoration, and what does a correct entry look like next to a broken one?

This guide answers with examples. Each one below is a complete, valid shape built with the free XML Sitemap Generator on Ovatly, which turns a plain list of URLs into a correctly formatted sitemap.xml file. The examples use only the fields the tool works with, so what you see here is what the generator produces: a urlset of url entries, each holding a loc, plus optional changefreq, priority and lastmod values applied across the list.

Contents

  • Quick answer
  • The shape of every sitemap file
  • Example 1: the smallest useful sitemap
  • Example 2: change frequency and priority added
  • Example 3: a last-modified date and an escaped URL
  • How these examples were built, step by step
  • Limitations and honest expectations
  • Common mistakes
  • FAQs
  • Conclusion

Quick answer

A good sitemap file is an XML document whose root element is a urlset. Inside it, each page gets one url entry, and the only element that entry must contain is a loc with the page's full absolute URL, protocol included. Everything else is optional: a changefreq saying how often the page changes, a priority between 0.0 and 1.0, and a lastmod date. The XML Sitemap Generator builds exactly this shape from a plain list of URLs, applies any optional values you choose across the whole list, and reports and skips lines that are not complete URLs instead of letting them corrupt the file.

The shape of every sitemap file

Strip away the optional fields and a sitemap has three layers. The urlset is the container for the whole file. Each url block is one page. Inside the block, the loc element carries the address. That is the entire skeleton; a file with nothing more than those three layers is already a valid sitemap.

The optional fields sit inside the url block next to loc. changefreq is a hint about how often the page changes. priority is a hint about the page's importance relative to other pages on the same site, on a scale from 0.0 to 1.0. lastmod records when the page last changed. Notice the word hint in the first two cases. The generator's documentation is blunt about it: Google largely ignores priority and changefreq values, and lastmod is used only when it is consistently accurate. The examples below include these fields because the tool supports them and other engines read them, not because filling them in earns better treatment.

Example 1: the smallest useful sitemap

This is a complete sitemap for a two-page site, with no optional fields at all:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
  </url>
  <url>
    <loc>https://example.com/about</loc>
  </url>
</urlset>

Two things are worth noticing. First, every loc holds a full absolute URL, including the https:// protocol. That is not a stylistic choice: entries must be complete absolute URLs starting with http:// or https://, and anything else does not belong in the file. Second, there is nothing else to notice, and that is the point. If your generator output has these bones, it is correctly formatted, however plain it looks.

Example 2: change frequency and priority added

This is the generator's own worked shape: the same two pages, with a change frequency of weekly and a priority of 0.8 selected. Because the tool applies the optional values across the list, both entries carry the same pair of values:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <changefreq>weekly</changefreq>
    <priority>0.8</priority>
  </url>
  <url>
    <loc>https://example.com/about</loc>
    <changefreq>weekly</changefreq>
    <priority>0.8</priority>
  </url>
</urlset>

Read this example with the honest caveat from the Quick answer in mind. The changefreq and priority values make the file more descriptive, and some tools and engines still read them, but Google largely ignores both. Set them if they describe your site truthfully, and spend no time tuning them page by page in the hope of better crawling. With this generator you could not tune them page by page anyway: the values you pick apply to every URL in the build.

Example 3: a last-modified date and an escaped URL

The third example shows a single entry with a lastmod date, and a URL that contains an ampersand:

<url>
  <loc>https://example.com/guides?bean=arabica&amp;roast=light</loc>
  <lastmod>2026-11-20</lastmod>
</url>

The address in the browser would read https://example.com/guides?bean=arabica&roast=light, with a plain ampersand joining the two parameters. Inside an XML file that character cannot stand as it is, so it is written as &amp;. The generator handles this for you: special characters in URLs are XML-escaped automatically, with & becoming & as the standard case. If you ever edit a sitemap by hand and add a URL with parameters, this is the detail that silently breaks the file when it is forgotten.

The lastmod value deserves the same care as the escaping. A last-modified date only helps when it is consistently accurate, because that is the condition under which Google uses it. A file where every page claims to have changed yesterday teaches engines to ignore the field entirely.

How these examples were built, step by step

  1. Open the XML Sitemap Generator and paste your URLs, one full URL per line, including https://.
  2. Optionally choose a change frequency, a priority and a last-modified date to apply to every URL in the list.
  3. Check the skipped-lines report if any URL was rejected. A line like example.com/about, without the protocol, is reported and skipped, because sitemap entries must be full absolute URLs.
  4. Copy or download the generated sitemap.xml and upload it to your site root.

That is the whole process behind all three examples above. The differences between them are only the optional values chosen at step 2. Once the file is live, the natural next step is handing its address to search engines, which is covered in our guide on how to submit your sitemap to Google Search Console.

Limitations and honest expectations

The protocol allows up to 50,000 URLs and 50 MB uncompressed per file. The generator enforces a practical cap of 2,000 URLs per build and tells you when it trims the list, so for a larger site you split the list into several files joined by a sitemap index rather than building one enormous file. The optional values are applied across the whole list, which keeps small and medium sites simple but means the tool is not the right instrument for a site that genuinely needs a different priority on every page.

The deeper limit is about what any sitemap can do. A sitemap is a discovery hint: it helps search engines find new or deep pages, and it does not improve rankings, which depend on the pages themselves. Listing a page is not a guarantee of indexing either. List the canonical, indexable pages you want found, and leave out redirects, noindexed pages and duplicates. More worked shapes and the full set of SEO tools guides live in the SEO category archive.

Common mistakes

  • Bare domains in the list. A line like example.com/about has no protocol, so it is reported and skipped. Paste full URLs, one per line.
  • Hand-editing without escaping. Adding a URL with an ampersand and leaving it unescaped makes the XML invalid. Let the generator escape special characters for you.
  • Listing pages that should stay out. Redirects, noindexed pages and duplicates do not belong in the file; the sitemap is the list of canonical, indexable pages.
  • Invented lastmod dates. Setting every date to today makes the field worthless. Use real dates, or leave lastmod out.
  • One file past the protocol limits. More than 50,000 URLs or 50 MB uncompressed in a single file breaks the protocol. Split the list and join the files with a sitemap index.

FAQs

Where do I put the sitemap file? At the root of the domain it describes, for example https://example.com/sitemap.xml, and reference it in robots.txt with a Sitemap line and in your search console accounts.

Should every page be in the sitemap? List the canonical, indexable pages you want search engines to find. Leave out redirects, noindexed pages and duplicates; the sitemap is a discovery hint, not a guarantee of indexing.

Why was one of my URLs skipped? Entries must be complete absolute URLs starting with http:// or https://. Relative paths and bare domains without a protocol are reported and excluded so the file stays valid.

Does a sitemap improve rankings? No, it helps discovery and crawling of new or deep pages. Rankings depend on the pages themselves.

How many URLs can one sitemap file hold? The protocol allows up to 50,000 URLs and 50 MB uncompressed per file. This tool enforces a practical cap of 2,000 URLs per build and tells you when it trims the list; split larger sites into several files joined by a sitemap index.

Conclusion

A good sitemap file is boring in the best way: a urlset, one url block per page, a full absolute URL in every loc, and optional fields that describe the site truthfully rather than optimistically. The XML Sitemap Generator produces that shape from a plain list of URLs, skips the lines that would break it, and escapes the characters that would corrupt it. Build the file, put it at your site root, and then make sure search engines know the address.