Seele Vol's Blog

Google Search Console 提交 Sitemap 的离奇错误

Google Search Console 实在是太不人性化了。出现错误就是不说错误原因。

总结

如果你认为已经做了很多尝试,不会有其他遗漏的了.请直接将

https://20220228.xyz/sitemap.xml

修改为类似下面的结构

https://20220228.xyz//sitemap.xml/

否则请往下看。

验证 sitemap 存在

curl https://20220228.xyz/sitemap.xml -I

验证 robots.txt 存在 及允许 谷歌机器人抓取

curl https://20220228.xyz/robots.txt

我的配置文件如下

# 允许Google和Bing的机器人抓取
User-agent: Googlebot
Allow: /

User-agent: Bingbot
Allow: /

# 拒绝其他所有机器人抓取
User-agent: *
Disallow: /

# 明确拒绝一些中国的机器人抓取
User-agent: Baiduspider
Disallow: /

User-agent: Sogou
Disallow: /

User-agent: 360Spider
Disallow: /

User-agent: YisouSpider
Disallow: /

需要注意的是,如果想要更彻底地拒绝抓取,建议使用 CDN 的防火墙功能,因为 robots.txt 仅仅是一个建议标准。