返回教程

收录排查 / Robots 与 Sitemap QA

如何检查 noindex、robots.txt 和 sitemap 冲突

上线时最常见的问题之一:sitemap 让 Google 收录某个 URL,另一条规则却告诉它不要抓取或不要索引。

检查 noindex 冲突

先看索引指令

先检查 meta robots 和 X-Robots-Tag。如果任何一个写了 noindex,这个页面就不应该作为可索引 URL 提交到 sitemap。

再看 robots.txt

robots.txt 控制抓取,不直接控制索引。不要用 robots.txt 屏蔽需要 Google 抓取后才能看到 noindex 或 canonical 的页面。

让 sitemap 和 canonical 保持一致

sitemap 只提交 canonical 且可索引的 URL。跳转页、重复页、参数页、测试页和 noindex 页都应在上线前移除。