A sitemap is a hint to search engines about which pages on your site matter. A bad sitemap is worse than no sitemap — it wastes crawl budget on dead pages.
Include only canonical, indexable URLs
Skip redirects, noindex pages, paginated archives, search-result pages, and admin URLs. If a page shouldn't appear in Google, it shouldn't be in the sitemap.
lastmod matters more than priority
Crawlers largely ignore the priority and changefreq fields. They do pay attention to lastmod when it's accurate — use it to signal real content updates.
Submit and monitor
Submit the sitemap in Google Search Console and check the coverage report weekly. Watch for the 'Discovered but not indexed' bucket — those are pages Google decided weren't worth indexing.