A proper sitemap.xml file is a UTF-8 encoded XML document that starts with an XML declaration and uses the namespace xmlns="http://www.sitemaps.org/schemas/sitemap/0.9". Each URL gets wrapped in a <url> tag containing at minimum a <loc> element with the full canonical URL including https protocol. You can optionally include <lastmod> in W3C datetime format, <changefreq> values like weekly or monthly, and <priority> from 0.0 to 1.0, though Google largely ignores the last two. Keep each sitemap under 50,000 URLs and 50MB uncompressed. If you exceed that, split into multiple sitemaps and reference them in a sitemap index file using <sitemap> tags instead of <url> tags. Include only indexable URLs—exclude noindexed pages, canonicalized duplicates, redirected URLs, and anything blocked in robots.txt. Don't include URL parameters unless they represent genuinely unique content. For most WordPress sites, Yoast or RankMath generates acceptable sitemaps automatically. For larger or custom-built sites, you'll want dynamic generation that pulls from your database and updates <lastmod> when content changes. At Ottawa SEO, we validate sitemaps with the official schema, test them in Search Console's sitemap report, and monitor crawl stats to confirm Google is actually using them. Common mistakes: including http versions when your site is https, mixing trailing slash conventions inconsistently, listing tens of thousands of low-value pagination or filter URLs, or forgetting to update the sitemap after major site changes. You should also compress to .xml.gz if your sitemap is over a few megabytes—search engines accept gzipped sitemaps and it speeds up their fetch. Submit your sitemap via Google Search Console and Bing Webmaster Tools, then reference it in your robots.txt with a Sitemap directive. Check back weekly at first to see if Google reports errors or excluded URLs. A clean sitemap won't guarantee indexing, but a broken or bloated one will slow discovery of new content and waste crawl budget on sites with thousands of pages.