Pinging google sitemap after every new article submission? [closed]
Asked Answered
O

5

31

As you may know, by using the following url, you can 'ping' google to update its record of your sitemap:

https://www.google.com/ping?sitemap=URLOFSITEMAP.xml

I made a script to do this programmatically after every article submission (I am making a user submitted blog type site).

Do you think its a bad idea to do this after every submission and would it be better to do this daily or after some interval?

I guess this would come down to whether or not there is a chance that doing this would stall the application execution. The pinging is not done asynchronously so I guess there is always a chance. I was just wondering if anybody has implemented this programmatically and what his/her approach was.

Osteoplastic answered 26/8, 2009 at 5:59 Comment(2)
I voted to close this question because it is not a programming question and it is off-topic on Stack Overflow. Non-programming questions about your website should be asked on Webmasters. In the future, please ask questions like this there.Metamathematics
See also: Should I ping to Google sitemap-index.xml or only the sitemap file that has been modified? and Is it okay to ping Google multiple times in a day when my sitemap is updated?Metamathematics
R
29

Yes, that method is allowed by google.

  1. Issue your request to the following URL:

    www.google.com/webmasters/tools/ping?sitemap=sitemap_url

    For example, if your Sitemap is located at http://www.example.com/sitemap.gz, your URL will become:

    www.google.com/webmasters/tools/ping?sitemap=http://www.example.com/sitemap.gz

  2. URL encode everything after the /ping?sitemap=:

    www.google.com/webmasters/tools/ping?sitemap=http%3A%2F%2Fwww.yoursite.com%2Fsitemap.gz

  3. Issue the HTTP request using wget, curl, or another mechanism of your choosing.

ADDED:

Based on the link I just given, there is an info in there, google says:

We recommend that you resubmit a Sitemap no more than once per hour.

Rameriz answered 17/12, 2012 at 0:21 Comment(2)
You are not fully answering his question... he wants to know if it would be good to do this several times, ofr just once. He already had the ping function.Bowls
@Bowls just added an info taken from the URL I gave.Rameriz
I
2

Take a look at the code for the Google Sitemap Generator Plugin for Wordpress. A lot of people use that and it does not seem to slow things down enough to notice. Whatever methodology they are using should be a good place to start.

Iover answered 26/8, 2009 at 6:20 Comment(0)
D
2

As of 2015, Google no longer suggests a rate limit in their documentation.

It is in Google's best interest to know when fresh articles are created so it is worth pinging them with your sitemap, or at least some kind of "Fresh Articles" sitemap when new articles are published.

Googlebot will request your sitemap every time your ping it. It sends requests headers to check the newness of the resource. So if you plan on submitting a sitemap frequently, make sure your server will handle the request correctly. Otherwise, you might return a 304 (Not Modified) and Googlebot won't actually get the file.

Darlinedarling answered 24/2, 2018 at 20:2 Comment(0)
T
1

There is no need to resubmit sitemaps anymore. According to Google this approach is outdated since 2020:

Resubmit a sitemap

You shouldn't need to resubmit a sitemap that we already know about, even if you've changed it. Google will notice any changes the next time we crawl your site.

You can check this article: Manage your sitemaps using the Sitemaps report in http://web.archive.org/.

2020:

enter image description here

2016:

enter image description here

Twerp answered 6/4, 2022 at 15:17 Comment(0)
C
0

The Yoast plugin automatically pings Google and Bing when a post is updated.

Source

Clachan answered 13/1, 2020 at 18:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.