16

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?

Kara
  • 6,115
  • 16
  • 50
  • 57
Darryl Hein
  • 142,451
  • 95
  • 218
  • 261

4 Answers4

20

http://www.google.com/webmasters/sitemaps/ping?sitemap=URL-encoded URL to your sitemap

chaos
  • 122,029
  • 33
  • 303
  • 309
2

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:

$data = file_get_contents("https://www.google.com/webmasters/tools/ping?sitemap={$sitemap}");
$status = ( strpos($data,"Sitemap Notification Received") !== false ) ? "OK" : "ERROR";
echo "Submitting Google Sitemap: {$status}\n";

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.

jaggedsoft
  • 3,858
  • 2
  • 33
  • 41
1

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 :-)

Ankit Anand
  • 151
  • 1
  • 3