Version: 1.0 Author: Stewart Farquhar Author URI: http://www.dicontas.co.uk/blog/ Prerequisites: ============================================================================== 1. WordPress 2.0.4 / 2.0.5 2. UltimateTagWarrior (UTW) 3.141 Plugin for WordPress 2 (http://www.neato.co.nz/ultimate-tag-warrior/) 3. Google Sitemaps 3.0b1 (http://www.arnebrachhold.de/2005/06/05/google-sitemaps-generator-v2-final) Configuration: ============================================================================== The PHP code is written for the UTW setting of 'url rewriting for local tag urls (/tag/tag instead of index.php?tag=tag)' is DISABLED i.e. all the outputted sitemap records use the format equivalent to http://www.dicontas.co.uk/blog/index.php?tag=the_utw_tag_name If you enable this setting to modify the line in the PHP script below: $utw_tag = "http://www.yourdomainname.com/blog/index.php?tag=" . $utwtag->tag; to: $utw_tag = "http://www.yourdomainname.com/blog/tag_base_url" . $utwtag->tag; where tag_base_url is replaced with your UTW's 'Base url' setting in Admin->Options->Tags In my case, this plugin worked with... Use url rewriting for local tag urls (/tag/tag instead of DISABLED Base url = /tag/ Include trailing slash on tag urls is ENABLED Please note: For this plugin, I am also using the Permalinks Redirect plugin, where this plugin always forces trailing slash to be added to all pages. See http://fucoder.com/code/permalink-redirect/ for more info on this plugin. You may have to modify the PHP line discussed above to insert/remove any trailing slashes to fit with your own WordPress configuration. Installation: ============================================================================== 1. Upload the UTWgoogleSitemaps.php file into your wp-content/plugins directory 2. Activate it in the Plugin options 3. Click on Rebuild Sitemap on the Admin->Options->Sitemap Administration Interface 4. Check the outputted sitemap.xml file that all UTW tags have been added and is fully XML compliant Disclaimers: ============================================================================== 1. The author takes no responsibility, in any form, for any actions or issues with the use of this plugin. 2. This plugin only works with the WordPress plugin versions listed above. 3. You are free to modify and use this script as you see fit. 4. You are responsible for the use of this plugin and your own website sitemap. Thanks to: ============================================================================== The author wishes to thank... Christine Davis for UTW plugin Arne Brachhold for Google Sitemaps plugin Scott Yang for Permalinks Redirect plugin ============================================================================== */ function GetUTWtags() { global $wpdb,$table_prefix; $utwtagObject = &GoogleSitemapGenerator::GetInstance(); //Please note the "&" sign! $utwtags=array(); //Query UTW tags table and add them into the array $utwtags=$wpdb->get_results("SELECT tag FROM " . $table_prefix . "tags" . ""); if($utwtags) { foreach($utwtags as $utwtag) { $utw_tag = "http://www.Replace-Your-Domain-Name-Here.com/blog/index.php?tag=" . $utwtag->tag; if($utwtagObject!=null) $utwtagObject->AddUrl($utw_tag,time(),"daily",0.6); } } } add_action("sm_buildmap","GetUTWtags"); ?>