Guides / Concepts explained

What Is a Sitemap? XML Sitemaps Explained Simply

A sitemap lists the pages you want search engines to know about. What goes in sitemap.xml, when you need one, how to submit it, and what to ask your AI builder.

Mythex Team · 2026-09-29 · 5 min read

A sitemap is a file — usually at yoursite.com/sitemap.xml — that lists the pages on your website you want search engines to know about. Google describes it as a way to tell search engines about your pages, videos and other files and how they relate, so they can crawl your site more efficiently. It's a helpful map, not a guarantee: search engines still decide what to crawl, index and show.

Why it matters when you build with AI

When you build a site with AI, the pages often exist before anyone links to them. A new site has no other websites pointing at it, and a single-page app may have pages that are only reachable after JavaScript runs. A sitemap gives search engines a direct list of your real URLs.

A few decisions sit behind that simple file:

  • Which pages to include. Public pages you want found — not login screens, admin pages or duplicates.
  • Which address to use. Your final domain, with https://, the same way every time.
  • Keeping it current. New blog posts, products or listings should appear without someone editing the file by hand.

If your site's pages come from a database — listings, products, articles — the sitemap should be generated from that data, not written once and forgotten.

An everyday analogy

A sitemap is like the directory board in a shopping centre lobby. You could find every shop by wandering the corridors, and regular visitors do. But the board lists every shop in one place, including the one tucked away on the third floor. It doesn't make a shop good or guarantee anyone visits — it just makes sure it can be found.

For a small centre with one corridor, the board is nice but not essential. For a huge one, or a new one nobody knows yet, it makes a big difference.

Do you need one?

Google's guidance, in short:

Your siteSitemap?
Small (roughly 500 pages or fewer) and every important page is linked from another pageProbably not required, but harmless
Large, with many pagesYes
New, with few links from other sitesYes
Lots of video, images or news contentYes, possibly with sitemap extensions for those
Pages only reachable through search boxes or filtersYes — and add normal links too

In practice, a sitemap is cheap to add, so many small sites include one anyway.

What a sitemap looks like

Here's a small XML sitemap for a bakery:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.examplebakery.com/</loc>
    <lastmod>2026-09-20</lastmod>
  </url>
  <url>
    <loc>https://www.examplebakery.com/menu</loc>
    <lastmod>2026-09-28</lastmod>
  </url>
  <url>
    <loc>https://www.examplebakery.com/custom-cakes</loc>
    <lastmod>2026-08-02</lastmod>
  </url>
</urlset>

Each <url> has a <loc> — the full address of the page — and optionally a <lastmod> date.

A few rules from Google's documentation:

  • Use absolute URLs. https://www.examplebakery.com/menu, not /menu.
  • Size limits. One sitemap can hold up to 50,000 URLs or 50 MB uncompressed. Bigger sites split into several sitemaps and list them in a sitemap index file.
  • lastmod should be honest. Google uses it only when it's consistently accurate, and it should reflect significant changes to the page — not a copyright year updating.
  • priority and changefreq are ignored by Google. Many sitemap generators still add them; they do no harm, but don't spend time tuning them.

Google also accepts simpler formats, such as a plain text file with one URL per line, or an RSS/Atom feed.

A worked example: a property listings site

Say you've built a site listing rental flats. It has a home page, an about page, a search page, and a page for each listing, like /listings/2-bed-flat-canal-street. Listings come and go every week.

What goes in. The home page, about page, area pages (/areas/city-centre) and every active listing page. Each listing's lastmod is the date its details last changed.

What stays out. The login page, the landlord dashboard, saved-search pages, and search results with filters in the URL (/search?beds=2&max=1200). These are either private or near-duplicates of other pages.

Keeping it current. Instead of a static file, the server generates sitemap.xml from the database each time it's requested (or on a regular rebuild). When a listing is let and removed, it disappears from the sitemap, and its page returns a proper "gone" or "not found" status.

Telling search engines. robots.txt includes a line pointing to the sitemap:

User-agent: *
Disallow: /dashboard
Sitemap: https://www.examplelets.com/sitemap.xml

And the owner submits the sitemap in Google Search Console, where the Sitemaps report shows whether Google could read it and how many URLs it found.

Common terms explained

TermWhat it means
SitemapA file listing the URLs you want search engines to know about.
XMLA text format with tags, used for most sitemaps.
<loc>The full URL of one page in the sitemap.
<lastmod>When the page last changed in a significant way.
Sitemap indexA file that lists several sitemaps, for large sites.
robots.txtA file at your site's root telling crawlers what they may crawl, and where your sitemap is.
CrawlingA search engine downloading your pages.
IndexingA search engine storing and understanding your pages so they can appear in results.
Canonical URLThe preferred version of a page when the same content has several addresses.
Absolute URLA full address including https:// and the domain.
Search ConsoleGoogle's free tool for submitting sitemaps and seeing search performance.

Common mistakes and misconceptions

  • "A sitemap gets me indexed." It helps discovery. Google says it doesn't guarantee crawling or indexing.
  • Relative URLs. /menu isn't valid in a sitemap; use the full address.
  • Wrong domain. Sitemaps listing a preview or staging address, or http:// instead of https://, point search engines at the wrong place.
  • Including pages you don't want indexed. Login pages, admin pages, or pages marked noindex send mixed signals.
  • Including broken or redirecting URLs. List the final, working address of each page.
  • A stale sitemap. A file written once at launch misses every page added since.
  • Faking lastmod. Setting today's date on every page each day teaches Google to ignore it.
  • Relying on the sitemap instead of links. Pages should also be reachable through normal links on your site.

What to ask your AI builder for

  • "Generate a sitemap.xml at the site root listing every public page, with absolute https:// URLs on my final domain."
  • "Build the sitemap from the database so new listings or posts appear automatically."
  • "Only update lastmod when a page's content actually changes."
  • "Leave out login, dashboard, admin and filtered search pages."
  • "Add a robots.txt that allows public pages and includes a Sitemap: line."
  • "Make sure every URL in the sitemap returns a 200 status and isn't redirected."
  • "If we go past 50,000 URLs, split into several sitemaps with a sitemap index."

Then submit it in Search Console. For the bigger picture, read what SEO is and SEO for AI-built websites.

Sitemaps in Mythex

Mythex doesn't generate sitemaps automatically; you ask for one in chat, and the agent adds it to your app's code. The docs recipe on SEO for your published app includes a starter prompt that covers a simple sitemap.xml and robots.txt alongside titles and meta descriptions. Use the address visitors will actually use — your mythex.ai subdomain or, on Pro, your custom domain — and publish again after changes so the live site serves the new files.

Questions

What is a sitemap in simple terms?

A sitemap is a file, usually called sitemap.xml, that lists the pages on your site you want search engines to know about, sometimes with the date each one last changed. It helps search engines discover and crawl your pages more efficiently.

Does every website need a sitemap?

Not always. Google says small sites of roughly 500 pages or fewer, where every important page is linked from other pages, may not need one. It helps most for large sites, new sites with few links from elsewhere, and sites with lots of media or news.

Does a sitemap guarantee my pages get indexed?

No. Google says a sitemap can improve crawling but doesn't guarantee every URL in it will be crawled or indexed. Pages still need to be useful and reachable.

How do I submit a sitemap to Google?

Add it in the Sitemaps report in Google Search Console, and add a line like 'Sitemap: https://example.com/sitemap.xml' to your robots.txt file so other crawlers can find it too.

What is the difference between an XML sitemap and an HTML sitemap?

An XML sitemap is a machine-readable file for search engines. An HTML sitemap is an ordinary page of links for human visitors. They serve different audiences, and a site can have both.

Keep reading

  • Frontend vs Backend: What's the Difference? — The frontend is what users see in the browser; the backend runs on a server and handles data, logic and security. How the two fit together, with an example.
  • How Domains and DNS Work: A Guide for Non-Developers — How domain names and DNS connect example.com to your app: registrars, nameservers, A, CNAME, MX and TXT records, propagation, and connecting a custom domain.
  • How to Set Up Google Search Console for Your Website — Add your site to Google Search Console: pick a domain or URL-prefix property, verify ownership, submit a sitemap and read the reports that matter.
  • How to Use LLM APIs: Tokens, Costs, Keys and Your First AI Feature — What an LLM API is, how tokens, context windows and per-token pricing work, how to keep your API key safe, and how to add a first AI feature to your app.
  • Native Apps vs Progressive Web Apps: Which Do You Need? — Native apps vs progressive web apps (PWAs): what each can do, iPhone limits as of September 2026, costs, and how to choose for your first version.
  • REST vs GraphQL: What's the Difference and Which Should You Use? — REST and GraphQL are two ways to design an API. How each works, with examples, the real trade-offs, and which one makes sense for an app you build with AI.

Start building free · Templates · Docs