You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 21:05:08