情况
生成sitemap文件后,google sitemap 检查报错误。注意 :此时baidu bing是可以通过的。
错误sitemap原文
<?xml version="1.0" encoding="UTF-8"?>
<urlset>
<url>
<loc>https://bjun.tech/?_x=ForSpider</loc>
<lastmod>2021-07-05 15:06:13</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
</urlset>
提示错误
命名空间不正确

解决办法
参考 sitemaps协议
在 urlset 增加属性 xmlns=“http://www.sitemaps.org/schemas/sitemap/0.9”
日期无效

解决办法
检查协议中日期格式 发现需要 YYYY-MM-DD

修改后sitemap原文
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://bjun.tech/?_x=ForSpider</loc>
<lastmod>2021-07-05</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
</urlset>
检测结果
