WordPress Wednesday: Patching UTW for WordPress 2.1

Techtites Daily: WordPress Wednesday

I still haven’t upgraded this blog to WordPress 2.1 because of a potential problem with Ultimate Tag Warrior on WordPress 2.1.
Tags would get deleted whenever a comment is added. Christine’s latest release too wasn’t able to fix the same.

082net.com has found a fix that has worked successfully for Donncha on his blog. I’ve applied the patch myself and will now be upgrading this blog to WordPress 2.1.

For those interested, modify ‘ultimate_save_tags()’ function on ‘ultimate-tag-warrior-actions.php’ about line 502:

if (isset($_POST['comment_post_ID'])) return $postID;
if (isset($_POST['not_spam'])) return $postID; // akismet fix
if (isset($_POST["comment"])) return $postID; // moderation.php fix

The above code will not solve the problem, because tags will disappear when comments are deleted or when you get a trackback. Please delete the above code changes, i.e. the last two lines of the above code.
Then around line 862, replace:

// Save changes to tags
add_action('publish_post', array('UltimateTagWarriorActions','ultimate_save_tags'));
add_action('edit_post', array('UltimateTagWarriorActions','ultimate_save_tags'));
add_action('save_post', array('UltimateTagWarriorActions','ultimate_save_tags'));
add_action('wp_insert_post', array('UltimateTagWarriorActions','ultimate_save_tags'));


// Save changes to tags
add_action('save_post', array('UltimateTagWarriorActions','ultimate_save_tags'));
if($wp_db_version < 3308 ) { // if lesser than WP 2.0
  add_action('publish_post', array('UltimateTagWarriorActions','ultimate_save_tags'));
  add_action('edit_post', array('UltimateTagWarriorActions','ultimate_save_tags'));
  add_action('wp_insert_post', array('UltimateTagWarriorActions','ultimate_save_tags'));

Thanks to Kirk for updating me about the changed fix. All credits for the new fix goes to 082net.com and Donncha for keeping us updated.
Also, Stephen has found an update on a bug that threw up 404 errors. It did effect me, but I hadn't given much of a thought about it.


30 thoughts on “WordPress Wednesday: Patching UTW for WordPress 2.1”

  1. Actually there is a problem with the latest release and the UTW website even acknowledges it. I’m not sure if someone has actually figured out exactly when it happens, but they say it occurs when pingbacks/trackbacks come in as well.

    I just implemented this fix because UTW was erasing some of the tags, so hopefully this will get me by until another release comes out.Thanks Ajay!

  2. Thanks for confirming the same too Ryan.

    Donncha confirmed to me that it is working for him properly now.

    What is your feedback so far? Still any problem?

  3. Pingback: Weblog Tools Collection » Blog Archive » Upgraded to WP 2.1 Ella

  4. Hello,
    thanks Ajay!
    I just implemented this fix too because UTW was erasing some of the tags when I was editing (or posting) my own comments.
    Now it works properly 😉


  5. You might want to check Donncha’s \”The new wordpress UTW \”Gotcha\” post again. He’s got a new patch up for the latest UTW due to the original one (in your post) left out a couple bugs and tags were still disappearing. Donncha expalains all about it in an update and has the new patch code there as well as instructions for application.

    I updated my latest release of the UTW plugin and no initial errors. I’ll have to wait and see if the tags stay put now.

  6. Pingback: Patching UTW for WordPress 2.1 » D’ Technology Weblog — Technology, Blogging, Gadgets, Fashion, Life Style.

  7. @gidibao: I just edited one of my own comments on my blog and the tags stayed put. I’m not saying your wrong, it may be because the theme I use (LetoPrime 0.9.6) is specifically coded for UTW if it’s installed. That didn’t stop tags from disappearing before the new patch was applied though. I still need to give it a few days just to make sure.

    So far, I’ve edited comments, Akismet has caught plenty of spam and there’s been several spam trackbacks thrown into moderation by the ‘Simple Trackback Validation’ plugin that I’ve had to flush out. So far, no tag losses but I won’t say there won’t be yet. Too soon

  8. @Ajay: yes, tags are still getting deleted 🙁
    I agree with Kirk M (thanks) maybe the theme I use (Andreas06) do not works properly with UTW (after I’ve upgraded my blog to 2.1)… 🙁

    Thanks 🙂


  9. I’m not sure it is the theme, because all the theme does is read the tags.

    Something in UTW is giving the problem. Did the older patch work well for you?

    Maybe you can go back to it and try that out.

    Tags on this post atleast haven’t been knocked off so far even with new comments.

  10. Hi,
    no Ajay, the older patch do not works (I have tried again ten minutes ago)…

    \”I do not know how\” but the newest one works properly now! I have re-uploaded the same actions.php edited just a few hours ago 😯

    thanks Ajay


  11. @gidibao & ajay

    Just to let you know, there are themes that are not compatible with 2.1 or should I say there are themes that are compatible. WP Codex has released a list of compatible themes here although it’s still a bit sparse (edited by bloggers and authors type of thing).

    Just info for the wise.

    I haven’t had any tag problems since I uploaded the (new) patched file. I did find that attempting to patch the actual file using manage/files editor doesn’t seem to work well in my case and I patched a local copy as you did, gidibao and FTP’d it. Then it worked fine.

  12. Correct about the compatibility Kirk, but that is WordPress compatibility. UTW compatibility is basically to display the tags.

    I never use the manage/files editor for updating. All my files don’t have write permission and always edit via FTP.

  13. Pingback: links for 2007-01-30 » thingslearnedtoday.com

  14. Pingback: WordPress 2.1 And UTW Database Issues » Connected Internet

  15. Pingback: WordPress Wednesday: Happy Birthday and More WordPress 2.1 at The Blog Herald

  16. Pingback: Ultimate Tag Warrior 修正してみる。 « kappadow.jp

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.