sitemap.xml 是给搜索引擎看的地图:里面逐条列出页面地址、更新频率(changefreq)、优先级(priority)与最后更新时间(lastmod)。对结构深、内部链接稀少、或新上线没有外链的站点,sitemap 尤其关键。主流 CMS 与建站系统都能自动生成,也可以用爬虫工具(如 screamingfrog)先抓全站再导出 xml。
提交方式:Google 用 Search Console 的 Sitemaps 功能,百度用搜索资源平台的普通收录提交。生成后必须保证里面的 URL 都是 200 可访问的,混入 404 或跳转地址反而浪费信任。sitemap 只是建议不是命令,搜索引擎仍会按自己的节奏抓取;同时要在 robots.txt 加 Sitemap 行做双重声明。内容型站点适合把 sitemap 拆成多个小文件再用 sitemap index 组织。
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://example.com/seo/keywords.html</loc> <lastmod>2026-10-01</lastmod> <changefreq>weekly</changefreq> <priority>0.8</priority> </url> </urlset>