What Is a Sitemap?
Last updated 2026-09-12
A sitemap is a file that lists a website's pages so search engines can discover and crawl them more efficiently, especially on large or newly-launched sites.
Understand what a sitemap contains
An XML sitemap lists page URLs, and often each page's last-modified date, so a search engine can find pages that internal links alone might miss.
Generate the sitemap
Most frameworks (including Next.js) can generate a sitemap.xml automatically from your route structure at build time, keeping it in sync with your actual pages.
Submit it to search engines
Add the sitemap URL to Google Search Console (and Bing Webmaster Tools) so crawlers know where to find it, and reference it from your robots.txt file.
Example
This site's own sitemap is live at /sitemap.xml — open it directly to see the real XML structure: a <urlset> containing one <url> entry with a <loc> and <lastmod> per page.
Important Considerations
- A sitemap helps discovery, but doesn't guarantee indexing — pages still need to meet quality and crawlability requirements.
- Keep a sitemap free of noindexed, redirected, or broken pages — listing them wastes crawl budget and can send mixed signals.
- For large sites, sitemaps can be split into multiple files referenced by a sitemap index.
Frequently Asked Questions
- Do I need a sitemap for a small site?
- It's less critical if internal linking is strong, but a sitemap is low-effort and still speeds up discovery of new or updated pages, so most sites include one.
- Where should robots.txt point to the sitemap?
- Add a line like "Sitemap: https://example.com/sitemap.xml" anywhere in robots.txt — this is the standard way crawlers find it without checking Search Console.