Google Site Mapping

June 11th, 2005 at 6:15 pm by james

I 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, “”.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.

2 Responses to “Google Site Mapping”

  1. badlard Says:

    what the ?! are you talking about?

  2. james Says:

    ben, ben, ben. what will we do with you?

Leave a Reply