Google Sitemap解析失败:urlset命名空间声明问题求助
站点地图解析问题求助
我的站点地图索引文件Google可成功抓取,内容如下:
<?xml version="1.0" encoding="UTF-8"?> <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <sitemap> <loc>https://example.com/sitemap-static.xml</loc> <lastmod>2025-06-17</lastmod> </sitemap> <sitemap> <loc>https://example.com/sitemap-posts.xml</loc> <lastmod>2025-06-19</lastmod> </sitemap> </sitemapindex>
Google能正常抓取https://example.com/sitemap-static.xml,但无法解析https://example.com/sitemap-posts.xml,报错信息:
Your Sitemap or Sitemap index file doesn't properly declare the namespace. Tag: urlset
该文件内容如下:
<?xml version='1.0' encoding='utf-8'?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"> <url> <loc>https://example.com/blog/abc</loc> <lastmod>2025-06-12</lastmod> <changefreq>daily</changefreq> <priority>0.8</priority> <image:image> <image:loc>https://example.com/abc.jpeg</image:loc> <image:title>ABC</image:title> <image:caption>DEF</image:caption> </image:image> </url> </urlset>
我已尝试以下方法但均未解决问题:
- 调整
sitemap-posts.xml中xmlns标签的顺序 - 移除文件中所有xmlns标签
- 仅保留
http://www.sitemaps.org/schemas/sitemap/0.9作为xmlns标签
恳请提供帮助。
内容的提问来源于stack exchange,提问作者Giorgi Tsertsvadze
相关产品推荐
相关产品推荐

