A Dirty Hack to Fix the Disappearing Tags Problem in Ultimate Tag Warrior

Ultimate Tag Warrior is a great Wordpress plugin that lets you add tagging to your blog and build your own folksonomy. You can use it to show related posts or a nifty tag cloud.

As of version 2.3, though, Worpdress has tagging built right in. That means that development on UTW has stopped, leaving us with a very nasty bug in the final version. After someone comments on a post (and the comment is approved), all the non-category tags are deleted.

This is a known bug in UTW 3.1415926. I’m not quite ready to take the plunge into Wordpress 2.3, digging up new plugins to add the features I want and changing our theme. So in the mean time, I found an ugly hack to stop our tags from vanshing into thin air.

  1. Go to your ultimate-tag-warrior-core.php file.
  2. Find the SaveTags function.
  3. Comment out the code that removes tags that are no longer associated with the post.

The end of the SaveTags function should look like this:

// Remove any tags that are no longer associated with the post.
/*
if ($taglist == “”) {
// since “not in ()” doesn’t play nice.
$q = “delete from $tablepost2tag where post_id = $postID”;
} else {
// lop off the trailing space+comma
$taglist = substr($taglist, 0 ,-2);

$q = “delete from $tablepost2tag where post_id = $postID and tag_id not in ($taglist)”;
}
$wpdb->query($q);
*/
$this->ClearTagPostMeta($postID);
}

Please note that this is an ugly hack.  It makes it much more difficult to remove tags from a post when you want to.  I find that we get comments on posts way more often than we ever want to remove tags, so it’s a god tradeoff for the time being.

Got a better solution?  Post it in the comment below.

Put Related Tags in Category Pages with Ultimate Tag Warrior

Blogs are an integral part of whole “web 2.0″ business, so it’s not too surprising that bloggers like adding tags to their posts. If you are using Wordpress, one of the best ways to add tagging functionality to your site is with a plugin called the Ultimate Tag Warrior.

This article won’t go into all the great features included with Ultimate Tag Warrior (UTW). If you are new to the plugin, I suggest reading this great article by Lorelle. You can use it to show related posts, tags related to a particular post, and a bunch of other stuff. But there’s no easy way to show tags related to a particular tag or category.

If you take a look at one of our category page, for example the Environment category page, you notice a list of related tags. Here’s how I did it.

(more…)