Categories
PHP

Ping your sitemap.xml to Google

Not to long a go we explained how to generate a sitemap.xml with PHP.

Well, there was something missing and I think really important, to ping Google about the changes in the sitemap.

Simplest way of doing this:

file_get_contents('http://www.google.com/webmasters/sitemaps/ping?sitemap=http://yoursite.com/sitemap.xml');

Remember to register your site at Google webmaster tools, since if you don’t will not work.