如何通过代码通知 Google 有更新的站点地图?
在 Google 帮助页面上:
https://www .google.com/webmasters/tools/docs/en/sitemap-generator.html#submitting
Google 提到有一种方法可以使用 HTTP 请求通知他们更新的站点地图。
单击该链接后,您将转到此页面:
http://www.google.com/support/webmasters/bin/answer.py?answer=34592&topic=8482&hl=en#ping
但没有有关在何处对什么请求进行 ping 操作的信息。
有谁知道这个地址是什么以及需要什么参数?
On this page of Google help:
https://www.google.com/webmasters/tools/docs/en/sitemap-generator.html#submitting
Google mentions that there is a way to notify them of an updated sitemap using an HTTP request.
When you click the link, it takes you to this page:
http://www.google.com/support/webmasters/bin/answer.py?answer=34592&topic=8482&hl=en#ping
But there is no information on where to ping with what request.
Does anyone know what this address is and what parameters are required?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
http://www.google.com/webmasters/sitemaps/ping?sitemap=站点地图的 URL 编码 URL
http://www.google.com/webmasters/sitemaps/ping?sitemap=URL-encoded URL to your sitemap
最简单的解决方案:
file_get_contents("https://www.google.com/webmasters/tools/ping?sitemap={$sitemap}");
这适用于每个主要的托管提供商。 如果您想要可选的错误报告,可以从这里开始:
至于您应该多久报告一次,只要您的网站可以处理来自 Google 机器人的额外流量而不减慢速度,您就应该在每次进行更改时执行此操作。
Simplest solution:
file_get_contents("https://www.google.com/webmasters/tools/ping?sitemap={$sitemap}");
That will work on every major hosting provider. If you want optional error reporting, here's a start:
As for how often you should do it, as long as your site can handle the extra traffic from Google's bots without slowing down, you should do this every time a change has been made.
Google 有完整的程序来通知他们更新站点更新,包括如何使用 http 请求(官方的 google 方法)以及使用他们的 feed 进行 ping。 在这里阅读官方文档
https://webmasters.googleblog.com/2014 /10/best-practices-for-xml-sitemaps-rssatom.html
希望有帮助:-)
Google has the complete procedure for how to notify them update site updates including how to ping using http request (the official google method) and also using their feed. Read the official document here
https://webmasters.googleblog.com/2014/10/best-practices-for-xml-sitemaps-rssatom.html
Hope that helps :-)
请参阅 http://www.google.com /support/webmasters/bin/answer.py?hl=zh-CN&answer=34609
See http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=34609