Google Site Mapping
June 11th, 2005 at 6:15 pm by jamesI installed an excellent plugin from Arne Brachhold today to generate Google Sitemaps for WordPress. My service provider doesn’t currently run Python at v2.2 so the standard Google script fails. Arne’s script was very simple to implement. I hacked in a line to allow me to add my gallery to the map, and also added the following function to ping Google to let them know the sitemap’s been updated (requires php “- -with-curl”):
function sm_pingGoogle($mapName = “sitemap.xml.gz”) {
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, “http://www.google.com/webmasters/sitemaps/ping?sitemap=”.urlencode(get_bloginfo(‘url’)).”%2F”.$mapName);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_exec ($ch);
curl_close ($ch);
}
I’m calling the function from after the fclose() calls in sm_BuildSiteMap(); I think this means that it’ll only ping if the file is successfully opened for writing.
Grab Arne’s sitemap plugin for WordPress.
June 11th, 2005 at 8:59 pm
what the ?! are you talking about?
June 11th, 2005 at 9:16 pm
ben, ben, ben. what will we do with you?