XML Sitemaps: Build a Clean Sitemap for a New Website
An XML sitemap is a machine-readable list of URLs you want search engines to discover. It is especially useful during a launch or migration, but only when the list is accurate.
What belongs in the sitemap
Include canonical, publicly accessible pages that you want indexed. For most sites, these are content pages, product or service pages, guides and other durable URLs. Each entry should resolve successfully and represent the preferred version of that content.
The sitemap is not a dump of every route your application can generate.
What to leave out
Exclude login pages, internal search results, temporary previews, redirects, 404 pages, duplicate parameter variants and pages intentionally marked noindex. If a URL redirects somewhere else, place the final canonical URL in the sitemap instead.
After a domain change, remove old-host URLs from the new sitemap unless a specific migration plan requires them elsewhere.
Keep URLs consistent
Use the same scheme and hostname that your canonical tags and navigation use. Mixing HTTP and HTTPS or www and non-www versions sends inconsistent signals. Pick the production form, redirect alternatives to it and use it everywhere.
Consistency also makes debugging easier because a crawler does not have to interpret several versions of the same page.
Validation and size
XML must be well formed. Large sites can split content across several sitemap files referenced by a sitemap index. Small sites often need only one straightforward file. Do not add complexity simply because a generator supports it.
Open the sitemap in a browser and inspect several URLs manually before submitting it anywhere.
Discovery and Search Console
Reference the sitemap in robots.txt and submit it through Google Search Console when appropriate. Submission helps discovery and reporting; it does not guarantee indexing. Search engines still evaluate whether pages are accessible, canonical, useful and eligible to appear in search.
A sitemap supports good site architecture. It does not replace internal links.
Automated checks can confirm whether a public signal exists and looks technically reasonable. They cannot replace human review of content, accessibility, security, business logic or legal requirements.
Check a website