Translate

Google Webmaster Tools: HTTP Ping

(Redirected from Pinging-and-robots-txt)

HTTP Pinging is a way to tell Google that your sitemap has changed. It is a simple HTTP query thus you can do it manually by visiting a special Google URL, but usually is initiated by automated scripts. You will have to submit the sitemap via the Webmaster Tools interface first, then you can rely on pinging.

The process of pinging is very simple:

1. discover the URL of your news sitemap; it mat look similarly to:

     http://www.example.com/google-sitemap.xml

2. create the ping URL; the ping URL consists of a special Google URL and your own news sitemap's URL discovered in step one. You will have to URL-encode your own URL:

     www.google.com/webmasters/tools/ping?sitemap=http%3A%2F%2Fwww.example.com%2Fgoogle-sitemap.xml
     Note: you have to replace the domain and the sitemap's filename with your own values in the above two examples

3. Open the URL created in step 2. You can do this with your browser, with wget, curl, etc., or from within a server side script with urllib (Python), Microsoft.XMLHTTP (ASP), fopen/file_get_contents/fsockopen (PHP), etc.


Best practices:

  • have at least a one hour window between two pings
  • capture the HTTP status code sent by Google in response to your ping. If the status code is other than 200, you may want to ping the Webmaster Tools interface again.
  • if you have a news sitemap index file, you want to send only the index file's URL in the ping