Inner page

Code, Docs & Tools

Search engines: how to automatically submit sitemap changes

Submit a new sitemap

Sitemaps are used to inform search engines about the list of pages available on a website.

Sittemap can be initially submitted to search engines using the webmaster tools each search engine gives to authors.

When the website structure changes (i.e. new pages are added), to obtain the best results in the indexing it would be good to resubmit the updated sitemap. But this could be annoying.

To make this action easier, search engines have an easy way to resubmit a sitemap: calling a special URL a sitemap could be updated without having to login into the search engine's webmaster panel.

How to update the sitemap on Google

To update the sitemap on Google, this URL can be called:

http://www.google.com/ping?sitemap=http://www.domain.com/sitemap.php

The http://www.domain.com/sitemap.php parameter has to be replaced with the correct sitemap URL.

How to update the sitemap on Bing

To update the sitemap on Bing, this URL can be called:

http://www.bing.com/webmaster/ping.aspx?siteMap=http://www.domain.com/sitemap.php

The http://www.domain.com/sitemap.php parameter has to be replaced with the correct sitemap URL.

How to automatically update the sitemaps

Sitemaps can be easily upgraded via a script, for example directly from the application used to change the content of the website.

This is the PHP code to update the sitemap on both Google and Bing:

//Google file_get_contents("http://www.google.com/ping?sitemap=http://www.domain.com/sitemap.php"); //Bing file_get_contents("http://www.bing.com/webmaster/ping.aspx?siteMap=http://www.domain.com/sitemap.php");

The http://www.domain.com/sitemap.php parameter has to be replaced with the correct sitemap URL.