如何正确使用网站地图?

你好。有人能给我解释一下——如何正确使用 Discourse 的站点地图吗?
在 Discourse 设置中,我启用了站点地图:

这是我的站点地图文件内容:

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://*******/sitemap_recent.xml</loc>
<lastmod>2024-08-13T00:43:48Z</lastmod>
</sitemap>
<sitemap>
<loc>https://******/sitemap_1.xml</loc>
<lastmod>2024-08-13T00:43:48Z</lastmod>
</sitemap>
</sitemapindex>

我将此站点地图添加到 GSC,看起来文件已成功导入,但它总是只显示一个找到的页面:

如果我尝试将 sitemap_1.xml 文件添加到 GSC,该文件实际上包含我所有的(或许多)页面,GSC 会因错误而无法导入它。

那么……帮助 GSC 索引我的网站的正确方法是什么?或者我不需要做任何事情,Google 在扫描 robot.txt 文件时会导入站点地图,之后我只需要等待?

嘿,您在 GSC 中输入的 URL 是什么?yourdomain/sitemap.xml?

[quote=“David_Ghost, post:2, topic:321496”]nyourdomain/sitemap.xml?
[/quote]
谢谢!是的,我想是的))
我在 GSC 上填写了表单,如下所示:


我认为这意味着域名已被包含。
我尝试以同样的方式添加 sitemap_1.xml:

但它不起作用。

尝试使用 httpS

https://wedframe.ru/sitemap.xml

2 个赞

再次感谢您,David!我不知道 GSC 中需要单独添加 http 和 https。我多年前就将此域名添加到 GSC,当时证书几乎没有被使用。显然,出于这个原因,无法在站点地图添加表单中使用 httpS 地址。但这不成问题。现在我已重新添加了我的资源,现在可以在此表单中使用 httpS。

但是,目前这也不能解决问题。当我打开此文件的处理数据时,我看到另外两个站点地图文件。而包含所有主题和类别的那个仍然由于错误而无法导入:

这个文件可能存在问题吗?也许主题/类别的名称可能包含某些不兼容的符号,从而违反了 xml 语法?我在 Notepad++ 中检查过,看起来 xml 是正确的。

请稍等。它会自行解决的。我有时也会遇到这种情况。半小时后再查看一下。

我刚检查了你的 sitemap_1.xml。对我来说看起来没问题。

2 个赞

您不应该使用 sitemap_1.xml,因为您永远不知道会有多少子站点地图。只使用普通的站点地图。

2 个赞

是的。目前我只添加了 sitemap.xml 文件。据我所知,sitemap_1.xmlsitemap_recent.xml 文件会在谷歌扫描 sitemap.xml 文件内容后自行出现在 GSC 中。

sitemap_1.xml 和 GSC 之间似乎出了点问题。现在(将近两天后)此文件仍显示错误,但同时 Yandex 却能毫无问题地导入此文件。

sitemap.xml 已成功导入

sitemap_recent.xml 也已成功遵循,但 sitemap_1.xml 显示“未收到”

然后我在 url-validation 中检查此文件,一切似乎都正常:

真是神奇……

我仍然不明白为什么您要发送_1和recent,而应该只使用sitemap.xml。

只需查看 sitemap.xml 文件的内容,您就会明白。
我只发送 sitemap.xml,而 sitemap_recent.xmlsitemap_1.xml 文件是 Google 扫描 sitemap.xml 文件内容后自动添加的。
我确信这是 Discourse 的开发者有意为之,因为 sitemap.xml 文件不包含任何关于主题和分类的信息,它只包含指向这两个文件的链接,而这两个文件又包含关于主题和分类的信息。
也就是说,最终扫描 sitemap.xml 文件会导致 Google 导入 sitemap_recent.xmlsitemap_1.xml

我的错。我当然是指 sitemap_index.xml。它的唯一目的是引导 Googlebot 访问子站点地图。这就是为什么你不指定 sitemap_x.xml(因为可能有多个,而且你永远不知道有多少个)和 sitemap_recent.xml 的位置。

你应该只发送索引站点地图,仅此而已。基本上,你试图发送 Google 不需要也不想要的站点地图是在浪费时间。

再说一遍……
我就是这么做的。我发送 sitemap.xml,而发送 sitemap_x.xml,也发送 sitemap_recent.xml,但在我发送 sitemap.xml 后,这些文件会出现在 GSC 中。
而且没有 sitemap_index.xml

好吧……如果你不使用它们,你为什么要问这些呢?:flushed_face:

我认为您没有理解 Google 如何处理 Discourse 的 sitemap.xml 文件的本质,因此您在打转。Google 在扫描 sitemap.xml 文件后会自行导入这些文件,但在我的情况下,sitemap_recent.xml 文件导入成功,而 sitemap_x.xml 文件导入时出错。

我很清楚,但是:

  • 这个“损坏的”站点地图不是来自谷歌,而是你发送的,你不应该发送
  • 圈子来自你的问题;同一个问题,每次都得到相同的答案

不管怎样。你还在浪费时间。

我已经告诉你很多次了。我只发送 sitemap.xml。我还能为你做什么?需要我录制视频吗?还是别的?

我认为只有你在浪费我的时间。最好不要再“帮助”我了 :open_hands:

你好,

你能把站点地图完全删除,然后重新发送一次吗?

我再次检查了一下,发现站点地图需要几秒钟才能正确加载。但我觉得这与它有六千个线程有关。

我尽力帮忙了,在我看来一切似乎都很正常。你们在这个 GSC 账户里还有其他的站点地图吗?

这是一个域名属性还是一个 URL 前缀?如果是 URL 前缀,请尝试使用域名属性。

1 个赞

Ok. I delete sitemap:

and send one more time:

Google say - it’s all right

And now then when I click on this newly sended sitemap.xml, I see two new files and theres steel one file with error “Not received”


Let me remind you that at the same time, another search engine (yandex) accepted the same sitemap.xml without any problems and then read the contents of the file sitemap_1.xml without any problems.
So… problem somethere beetwen google and this sitemap.

At this time no. Earlier in this account there was a sitemap built in vbulletin. And there were no problems with it. But at the moment, I deleted the old sitemap

First I was try with url, but then i used a domain.

此时没有。以前在此帐户中有一个 vbulletin 内置的站点地图。它没有出现任何问题。但目前,我已删除旧站点地图

起初我尝试使用网址,但后来我使用了域名。

我觉得这听起来很奇怪。我看不出有什么问题。一切都正确。我希望这里的其他人能给你带来解决方案。我再也看不出有什么不对了。

1 个赞