=== Google Sitemaps - UTW Tag Addon === Plugin Name: Google Sitemaps - UTW Tag Addon Plugin URI: http://www.dicontas.co.uk/blog/google-sitemap-utw-tag-wordpress-plugin/ Description: This plugin will automatically append all the tags used within Ultimate Warrior Tags plugin to your XML sitemap that is generated by the Google XML Sitemap Generator plugin Version: 1.1 Stable tag: 1.1 Author: Stewart Farquhar Author URI: http://www.dicontas.co.uk/blog/ Tags: google, sitemaps, google sitemaps, yahoo, msn, xml sitemap, xml, sitemaps, ultimate tag warrior, tags, tag == Description == This WordPress plugin automatically appends all your blog tags generated by the Ultimate Tag Warrior WordPress Plugin onto the end of the Google Sitemap XML (sitemap.xml) file as generated by the Google Sitemap Generator for WordPress Plugin. For example, say you have 60 UTW tags in your blog, and you execute the Google Sitemap Generator plugin to re-create your latest sitemap, then this plugin will automatically append all 60 tag URLs onto the end of the newly generated sitemap.xml file. This means that the Google / Yahoo / MSN (Windows Live) search engines will be made aware of all your internal tags and should then scan and index your tagged directories for your specialised (tag-sorted) content. This should help your blog to achieve higher search engine rankings for your tagged pages. == Prerequisites == This plugin relies on the following plugins and versions to work... 1. WordPress 2.0.4-2.0.10 and WordPress 2.1.2 (tested 9th March 2007) 2. Ultimate Tag Warrior for WordPress Plugin (v 3.141 - v3.1415926 for WP2.0.x) 3. Google Sitemap Generator for WordPress Plugin (v3.0b1 - v3.0b6 for WP2.0.x) This plugin is WordPress v2.1.x compatible - but you must use the latest versions of these two plugins listed below: Ultimate Tag Warrior for WordPress Plugin (v3.1415926 or above) at http://www.neato.co.nz/ Google Sitemap Generator for WordPress Plugin (v3.0b6 or above) at http://www.arnebrachhold.de/2006/01/07/google-sitemap-generator-for-wordpress-3-beta This WordPress plugin is also located at http://www.dicontas.co.uk/blog/downloads/UTWgoogleSitemaps.zip == Installation == 1. Download the zip file above. 2. Extract the zip file to a local directory on your computer. 3. Modify the PHP script to reflect your Ultimate Tag Warrior configuration settings (see below) 4. Upload the UTWgoogleSitemaps.php file into your wp-content/plugins directory 5. Activate the WordPress ‘Google Sitemaps - UTW Tag Addon’ Plugin in the Plugins options screen 6. Click on Rebuild Google Sitemap on the Admin -> Options -> Sitemap Administration Interface 7. Check your outputted Google Sitemap file (sitemap.xml) to make sure that all your Ultimate Tag Warrior tags have been added and are pointing to the correct URLs. **** Check for any missing trailing slashes (/) **** Use Google Sitemap Generator v3.0b6+, as this allows you to easily check your new sitemap by clicking on each tag entry. == Known Issues == 1. Your tag name must not contain an ampersand ‘&’ - if it does, please rename tag without an ampersand - or read the section below. 2. No other reported issues at the moment. If you must use ampersands in any of your tags, then there is a PHP function called urlencode() that replaces non-alphabetic characters with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs. See the PHP: urlencode() site for more info on this function at http://uk.php.net/urlencode This “should” sort out the ampersand problem if you modify the line below: AddUrl($utw_tag,time(),”daily”,0.6); to... AddUrl(urlencode($utw_tag),time(),”daily”,0.6); However, I have not tested this solution as I do not use ampersands in any of my tags and the PHP: urlencode() site’s comments do warn of some inconsistencies in using this method. == Configuration == i) The first configuration setting in the Ultimate Tag Warrior plugin is... ‘url rewriting for local tag urls (/tag/tag instead of index.php?tag=tag)‘ If this setting is DISABLE (unticked by default) then DO NOT modify (line 18) in the code: $utw_tag = get_bloginfo('url') . '/index.php?tag=' . $utwtag->tag; domain name URL example: www.blog.com/index.php?tag=some-tag-name If you ENABLE the 'url rewriting' setting then modify this line in the code to ... $utw_tag = get_bloginfo('url') . '/tag/' . $utwtag->tag . '/'; domain name URL example: www.blog.com/tag/some-tag-name/ This assumes that you have kept your 'Base url' setting as "/tag/" in Ultimate Tag Warrior. (for this value go to WordPress Admin -> Options -> Tags menu) ii) If you have changed your 'Base url' from the default value of '/tag/' then you need to reflect this change in the above code. domain name URL example: www.blog.com/tag/some-tag-name/ For example, if you wish to have a 'Base url' = '/tags/' then modify the line to... $utw_tag = get_bloginfo('url') . '/tags/' . $utwtag->tag . '/'; domain name URL example: www.blog.com/tags/some-tag-name/ iii) If you have 'Include trailing slash on tag urls' DISABLED then you will have to modify this line to... $utw_tag = get_bloginfo('url') . '/tag/' . $utwtag->tag; domain name URL example: www.blog.com/tag/some-tag-name == Plugin History == Release Date - Version - Description 24/09/06 - v1.0 - Initial Release 24/03/07 - v1.1 - added use of get_bloginfo('url') to get default blog address == Sitemap Settings == There is a line in the plugin script (line 19) that statically sets the ‘change frequency’ and ‘priority’ for your tags, i.e. AddUrl($utw_tag,time(),”daily”,0.6); Please modify this line to meet with your own tag page requirements, such as: change frequency - “always”, “hourly”, “daily”, “weekly”, “monthly”, “yearly”, or “never” priority - from 0.1, 0.2, .. 0.9 or 1 for example, AddUrl($utw_tag,time(),”weekly”,0.4); == Issues and Rollback == If you are having issues with this plugin, check the following: 1. Are you using WordPress 2.0.4-2.0.9+ or 2.1 with the required plugin versions and are all plugins activated? 2. Have you configured the code discussed above to align with your Ultimate Tag Warrior settings? 3. You have no ampersands in any of tag names - or you are using urlencode() fix? 4. If you are getting a ‘Fatal error: Undefined class name ‘googlesitemapgenerator'’ error when trying to rebuild your sitemap - this means you are not using v3+ of the Google Sitemap Generator - please update to v3.0b6 or above. 5. Have you checked your new ’sitemap.xml’ file to make sure that all the URL addresses point to the correct tag URL addresses - simply copy and past a few URLs from the sitemap.xml file into your browser to check that you have configured this script correctly. If you have not, simply deactivate this plugin, modify the script as instructed, and reactivate the plugin, then rebuild your sitemap using the Google Sitemap Generator plugin. Recheck your sitemap.xml. Check that the trailing slash (/) is present in your tag URLs if you are using the /tag/tag_name option, or use an additional plugin called ‘Permalinks Redirect‘ to sort this issue out. If the answer is yes to all of the above questions, then you can simply deactivate the WordPress Plugin and remove the PHP file from your plugins folder. There is no risk in upsetting WordPress as no core files or database tables are modified by this plugin.