XML Sitemap
An XML file listing your website's URLs to help search engines discover and index your pages efficiently.
An XML sitemap is a file in XML format that lists the URLs on your website that you want search engines to index. It's the technical version of a sitemap, designed specifically for search engine crawlers rather than human visitors.
A basic XML sitemap entry includes the URL and can optionally include: lastmod (when the page was last updated), changefreq (how often it changes), and priority (how important it is relative to other pages on your site). Search engines use these hints to crawl more efficiently.
Your XML sitemap should be accessible at yoursite.com/sitemap.xml and referenced in your robots.txt file. Submit it to Google through Search Console and to Bing through Webmaster Tools.
Best practices: only include canonical, indexable URLs. Don't include redirected URLs, noindexed pages, or error pages. Update the lastmod date when content actually changes (don't fake it). For large sites, use a sitemap index file that references multiple sitemap files.
Most modern CMS platforms generate XML sitemaps automatically. For custom-built sites, tools and libraries can generate them programmatically.
Why It Matters for SEO
XML sitemaps ensure search engines know about all your important pages, especially new content, deep pages with few internal links, and pages on large sites. They speed up the indexing process and help search engines understand your site structure.