(Later – Scroll to the end of this post for a small patch to fix the problem with disappearing tags!)
As seen elsewhere and of course on the official blog, WordPress 2.1 was released to much fanfare yesterday.
It works great, I’ve been using the development version on my blogs for quite a while now and until recently it worked swimmingly. It still does, but some time in the last 2 weeks Ultimate Tag Warrior stopped working properly. Whenever someone made a comment on a post the tags on that post would be deleted. It’s gotten so bad now that I’m moderating all comments, and opening those posts in the editor before approving the comments.
A half-way fix is available but moderated comments will still delete the tags so once I verify that the fix does what it does comment moderation will go back to the way it was before.
You should upgrade WP-Cache to the new 2.0.22 release too. It fixed problems I was seeing here with comments and posts not showing up until I deleted the cache manually. Yay!
If you’re interested, a new WordPress MU release will follow in a day or so. More here.
I forgot to mention, do I recommend you upgrade to WordPress 2.1? Yes. If you run a site that is in any way popular your database server will thank you. WordPress uses the MySQL query cache in a much more efficient manner than ever before when reading posts. Make sure your query cache is activated and tweak it until you hit the sweet spot. It’ll make a big difference when your server is under load.
Fix Fix Fix!
HandySolo spotted a simple fix for the tag problem! Check out the thread on this post and scroll to the entry by 082net.com where he outlines a simple fix for the disappearing tag problem. I just tried it and it works!
Here’s a temporary patch for resetting tags.
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
Even with the fix above, deleting a comment will delete the tags, and sending a trackback/pingback will do the same. 082net.com fixed that too. You can remove the above fix and apply the following.
Around line 862 of ultimate-tag-warrior-actions.php find the following chunk of code:
// 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'));
Replace that code with:
// 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'));
}
PS. Stephen Spencer has discovered why UTW doesn’t always work with custom permalinks. This is a longstanding bug, and it’s why I had to use the ?tag= format on my photoblog.
You might also like
- PHP is_numeric() vs is_int()
Some lessons you don't forget, but this one I
If you like this post then please subscribe to my full RSS feed. You can also click here to subscribe by email. There are also my fabulous photos and funny videos to explore too!

can you use a template tag like this:
&after=&show_images=1&show_description=0&orderby=url); ?>
(I took it from here http://codex.wordpress.org/Template_Tags/wp_list_bookmarks)
And where is the others new APIs in codex? Sorry, but I dont think this is a good work…
Hm, more where, exactly?
Hmm, so wp-cache 2.0.22 works properly for you? For me, comments and posts still don’t show up until I clear cache. :-/
Thanks for the heads-up on the UTW issue. Gives me something else to test a bit better before I pull the trigger on the upgrade!
Niklas – more here in a few days time
michelem – I can use those tags just fine. They’ve been like that for a few years now so I’m quite sure people are used to them by this stage. Are you offering to document the new APIs? The documentation is a volunteer effort and having another hand to help would be great!
HandySolo – That’s unfortunate. All caching problems disappeared when I upgraded. Are you sure you upgraded all files? Or you could downgrade to 2.0.19 again, although that does have a strange ob_flush problem.
If you do downgrade, grab my patch that improves the caching if you’re getting a lot of spam comments (and who isn’t in this day and age?)
I don’t seem to have the utw problem after the upgrade (unless I understood your explanation – quite likely!).
I am using utw 3.141592
Tom
Tom – I can replicate the problem by entering a test comment that akismet will catch (using names like “test commenter99″ and email address of “test@test.com” seems to be a good way to make that happen). Once I release the comment from akismet, tags gone. However…
Donncha – Did you see the comment from 082net at the UTW release thread? Adding two lines of code seems to have fixed things.
I hope to hear a final version soon.I had been using this plugin and its really awesome.I need not to say that but my thanks for this plugin u made.
I will keep track of thee post
Thx and Regards
Ashish
I don’t think that I’m game to upgrade to WP2.1 until this UTW thing is sorted out. How annoying! (The joys of the upgrade path
)
Thanks HandySolo, that was it. Hopefully Christine will package that fix into a new release soon!
Matt – nothing stopping ya now from upgrading!
Same here – WP_Cache 2.0.22 didn’t dump the cache on new comments so they didn’t show up. I’m still running an older version for now.
Still going to try WP 2.1 on a couple of my smaller sites – we’ll see how it goes. Hitting the MySQL query cache more often is a great thing!
No wonder my tags had been mysteriously disspearing. Thanks, Donncha!
Hi Donncha, is that fix for UTW working for you well here.
I want to upgrade to 2.1, but just holding it off until I’m sure UTW works. After SK2, this is my most needed plugin.
Ajay – it works fine, on this blog and on http://inphotos.org/ too, and I’ve approved several comments since applying the fix!
Strange
I have been running UTW (unpatched) with RC2 for a few days without any problems and quite a few comments.
I think I might update UTW with the patch and then upgrade to a final release version of WP
I read that earlier today but didn’t upgrade because from the last post on the UTW site and from the strikeout comment at the top it seemed like there was still an issue.
BigBerries – it’s working fine now. I approved your comment and my tags are still there
I posted this over on Neato also and wanted to let you know:
The fix by 082.net works; however, if you delete the comment that you approved in the first place, the tags somehow get deleted as well.
Great to hear that Donncha, but will I need to moderate my comments?
I don’t think so… cause my comment just got posted and tags didn’t disappear
Thanks for finding this out … !!!
It’s worth noting that the tag resetting issue also occurs whenever a post receives a pingback or trackback. I reported this issue to Christine a while back, hopefully she can push out a more comprehensive fix for it soon.
odd, the tag reset bug doesn’t seem to have any effect on my install. what version of UTW are we talking about here?
Damn, I hadn’t spotted the tag deletion problem – thanks for this post!
You can also just use
if (!is_admin()) return $postID;
if (!isset($_POST['tagset'])) return $postID;
in UTW’s actions file, as per my blog entry from December
. Especially the isset($_POST['tagset']) should catch *all* vectors – if the admin is to delete all tags, tagset will be *set* but empty.
Donncha – do you know if anyone has told Christine?
Collin, see my comment above.
Awesome — great stuff, folks!
Maybe tonight I upgrade.
I’m not seeing this problem either on two upgraded blogs
Good new fix. Your original fix did just what it was supposed to and the new fix appears to clean up the rest of the incompatibility problems.
Many thanks
Doh. I future-posted an article today. It showed up without tags (fix above applied). Watch for that.
THANK YOU. I noticed tags disappearing a few days ago, but couldn’t even figure out why it was happening.
i have another problem with utw, when i try to activate the pluggin, the page goes blank. so i cannot activate it. i never had problems with utw in my last server, now i am migrating everithing and it doesnt work.
what could it be?
thanks
Months later I finally get annoyed and check into this! aghhh. I thought I was doing something wrong with my tags and it was a getting confused, but now I know. Thanks Donncha !
I’ve been having the same problem as HandySolo when testing the post-in-the-future option. Does anyone have an idea about what’s going wrong ?
[...] instance, Ultimate Tag Warrior users: The new WP UTW gotcha and this UTW Support forum post are worth keeping an eye on. Summary: Approved comments delete [...]
[...] Fix zu UTW gibts auch schon, so verschwinden Tags gern mal gen [...]
[...] Technorati tags. However, there is a little problem with UTW and the latest version of WordPress. Donncha O’Caoimh has the fix. For more information and support, visit the Ultimate Tag Warrior support [...]
[...] Wochenende versprochen. Der Ultimate Tag Warrior funktioniert auch nur wie er will. Zwar gibt es obskure Hacks, aber da ich nicht im geringsten verstehe, was ich da im Sourcecode ändern müsste, lasse ich [...]
[...] bit the bullet and did the upgrade this evening, once I saw that there seemed to be a simple patch for the UTW issues I had mentioned the other [...]
[...] going to cherry pick comments or because I don’t trust you lot, but it’s because of a bug with UTW and WordPress 2.1 that deletes the tags off a post if a comment is made. Until this bug is [...]
[...] Had problems with UTW, which Donncha had mentioned. Good thing is that Donncha’s post also contains the solution, which worked [...]
[...] Acabo de darme cuenta de otro problema de compatibilidad con WordPress 2.1, que afecta a los usuarios del plugin Ultimate Tag Warrior: las etiquetas tan laboriosamente añadidas a una entrada desaparecen si alguien hace un comentario en ella, o si la entrada recibe un trackback o un pingback. El caso está descrito, junto con su solución (casi siempre hay una solución, más o menos elegante), en The new WordPress UTW gotcha. [...]
[...] solución, como comentan en The new WordPress UTW gotcha consiste en eliminar el siguiente bloque de código que empieza en la línea 862 de [...]
[...] 也许有人已经发现了,当你升到 Wordpress 2.1 后,只要有人在你的帖子上留言,或是发 Trackback 或是 Pingback 的时候,帖子的 Tag 就会消失(是被删掉,事实上)。说原因前我先贴一下修补 (via),然后有兴趣的同学再慢慢看原因。 [...]
[...] WordPress Plugin, one of the most popular WordPress Plugins, has a new release, though there is a fix from Donnch O’Caoimh and another version of the fix from Techtites to get it working with WordPress [...]
[...] UTW插件的问题: 插件作者在自己的页面上说,已经兼容wp2.1了,发表评论不会再删除文章的tags,但是审核一个评论却会删除。还有其他一些问题,解决起来似乎都很麻烦。作者也没有提出更新的解决方案。还是要再等等看吧。另外还有一两篇文章提到这个问题:http://bemike.org/blog/2007/01/28/compatibility-issue-between-wp-and-utw.html, http://ocaoimh.ie/2007/01/23/the-new-wp-utw-gotcha/ [...]
[...] The actual upgrade was performed around the beginning of the fourth week, right where the processor usage went to null. There was some testing done before and after the upgrade along with some fixes to the various plugins that needed optimization and tweaks, especially Ultimate Tag Warrior (which had cause some performance problems and had bugs. Fixed thanks to Donncha’s help). [...]
[...] It seems popular WordPress plugins, Ultimate Tag Warrior and WP-Cache have fallen foul of the recent update as described here, The new WordPress UTW gotcha. [...]
[...] I found the fix over at Donncha’s blog. [...]
[...] che succede via xmlrpc, per esempio), mi fa superimpazzire. Ora pare ci sia un fix, lo trovate qui. Lo sto provando, vi farò sapere se [...]