Natural Search Blog

Getting 404 errors with Ultimate Tag Warrior?

If you’re running WordPress and you care about SEO, then you’re probably running the Ultimate Tag Warrior plugin too. If you don’t know what I’m talking about, then read my blog SEO tip on tagging.

There’s been a long-standing bug in WordPress 2.X, ever since WordPress switched to internal rewrites instead of external ones within .htaccess. The bug is that UltimateTagWarrior displays 404 errors (File Not Found) on tag pages when you have rewriting of local tag URLs turned on (in Options > Tags in the WordPress admin). The bug usually only manifests itself when you are using custom permalinks (i.e. if you’ve selected “Custom” from the Permalink Options in the WordPress admin).

Well I’ve got good news! I’ve figured out the problem!

Turns out when you have a Custom Permalink structure like /%postname%/ defined, then one of WordPress’ rewrite rules matches against /tag/whatever before the rewrite rules (which are at the end of the list) get a chance to be invoked. Here’s the offending rewrite rule that’s doing the hijacking:

[[^/]+/([^/]+)/?$] => index.php?attachment=$1

That rewrite rule is a bit too greedy!

I used the Internal Rewrite Viewer plugin to figure out what was going on. This Ultimate Tag Warrior bug been a source of frustration for months. Man, it was tricky to track this one down. It’s good to finally know what the issue is — and how it can be fixed!

Other plugins like WP-Print and WP-Email aren’t affected by this because their rules are the very top of the array instead of the bottom.

I’ve alerted Christine, the author of UTW. Hopefully she will come out with an updated version of the plugin soon to put the rules at the top of the array. If not, I’ll will fix the plugin myself and publish the hack here.

replica rolexs

21 comments for Getting 404 errors with Ultimate Tag Warrior? »

  1. MyAvatars 0.2

    Ah! That makes sense. I have the exact same problem on my photoblog and it was driving me crazy because the same configuration worked perfectly on my other blog, except the permalinks are different.

    Did you try adding a mod_rewrite rule to redirect to index.php?tag=xxx ? I did but it didn’t make things any better unfortunately.

    Like you, hopefully Christine will fix it soon.

    PS. if you’re going to upgrade to WP 2.1, take a look at my gotcha post. UTW tags are deleted when someone leaves a comment, but there’s a fix available!

    Comment by Donncha O Caoimh — 1/23/2007 @ 11:05 am

  2. MyAvatars 0.2

    I’m getting this error now after upgrading to WP 2.1. It used to work fine.

    Seems there isn’t a solution to this yet?

    Comment by Leonard — 1/26/2007 @ 11:21 pm

  3. MyAvatars 0.2

    has anyone figured this one out yet? thanks a bunch!

    Comment by Matt — 2/5/2007 @ 10:05 pm

  4. MyAvatars 0.2

    i read this on the UTW forums a while back..

    i lost the original link but the “fix” was made by a guy named Andrew. Anyways, it worked for me in wp2.0.4 to wp2.0.7 and now it worked for me again in wp2.1.

    i’ll just paste the snippet exactly as i found it:


    the bug still existed but was identified and fixed by editing the following core wp file: /wp-includes/classes.php

    and adding the following code:

    if ( eregi ( �tag/�, $request_match ) ):
    $query = str_replace ( “attachment=�, “tag=�, $query );

    You should put this code in the WP class, parse_request() method. I inserted the code just after:

    eval(�\$query = \�$query\�;�);
    $this->matched_query = $query;

    In the default WordPress 2.0.3 wp-includes/classes.php, this code is located on line 1551.

    Comment by elran — 2/9/2007 @ 2:35 am

  5. MyAvatars 0.2

    so i still couldnt figure out how am i going to do it ?

    can someone help me ?

    Comment by ozgur — 3/4/2007 @ 8:34 pm

  6. MyAvatars 0.2

    I’m afraid I’m a little confused… not really quite sure what to do for the fix… does this mean we should definitely switch back to using tag= rather than tag/tag?
    Thanks 😀

    Comment by Mosey — 3/17/2007 @ 11:15 pm

  7. MyAvatars 0.2

    So if I change the rewrite rule to include the post ID, will that resolve it?

    Comment by Justin Cook — 5/5/2007 @ 6:25 am

  8. MyAvatars 0.2


    I have this problem for couple of weeks now ever since I installed UTW.

    I am a newbie for internet. Can anyone help me with this. I use
    wordpress 2.1.3 and latest UTW.


    Comment by Nick — 5/21/2007 @ 2:18 am

  9. MyAvatars 0.2


    you wrote:

    “It’s good to finally know what the issue is — and how it can be fixed!”

    Am I missing something or haven’t you written /how/ one is able to fix this? :-)
    Do you mind sharing your knowledge with us?

    Or could you fix the problem and post the hack here — it’s been 4 months since you alerted Christine.


    Comment by Stefan F. — 5/28/2007 @ 7:46 am

  10. MyAvatars 0.2

    I’m also facig the same problem.

    Can you please post the fix in your site.

    Comment by Jimmy — 5/30/2007 @ 6:24 am

  11. MyAvatars 0.2

    Yes I would love to see a fix posted so I can implement it myself!

    Comment by Ian — 6/1/2007 @ 1:55 pm

  12. MyAvatars 0.2

    OK, it works now. I installed the latest version (.314159265 from February 4th) and rebuilt the permalink structure.
    I somewhere read that rebuilding the permalink structure solves problem. I don’t now if the latest and greatest version of the plug-in is also necessary but it solves another problem (deleted tags after new comments arrived).

    Comment by Stefan F. — 6/1/2007 @ 5:09 pm

  13. MyAvatars 0.2

    Stefan F is right. Once UTW is installed, and configured with the tags/tagname structure. Go to Options > Permalinks and “update permalink structure’ without the need to change your custom structure. And it should all work.

    Comment by Ernie — 6/13/2007 @ 5:20 am

  14. MyAvatars 0.2

    Yep I second that. I went in and updated my permalinks and it’s working fine now.

    Comment by Justin — 6/13/2007 @ 11:56 am

  15. MyAvatars 0.2

    Thanks to all who commented. I can confirm that if you follow Ernie and Stefan’s suggestions, it works.

    I’ve just tried it on a brand new installation, and it worked like a dream.


    Comment by Chris — 7/20/2007 @ 4:42 pm

  16. MyAvatars 0.2

    Hi there, I already posted my problem on Lorelle’s blog but she can’t help and I really need a solution.

    I installed UTW (UTW 3.14 WP 2.2.1) and I have a problem: I use UTW_ShowWeightedTagSet and when I click on Movies, the url is:

    The problem is that it’s sending me back to my home page… Maybe it has something to do with my subdomain? I can’t change it, its: I checked into Options > Tags and I can’t find where I could modify anything to make it work.

    I tried to post on UTW Webpage but my comment is awaiting moderation for 2 weeks so I thought maybe you could help me about it. Thx ^^

    Comment by Alphie — 7/25/2007 @ 12:57 pm

  17. MyAvatars 0.2

    I nominate Stefan F. For President. Excellent, simple, and straight to the point solution.. UTW homepage should have this as one of the key reminders during installation.

    Comment by Nick — 8/14/2007 @ 3:44 pm

  18. MyAvatars 0.2

    Hi Stefan F and all,

    Thanks for all your suggestions and recommendations, I was able to solve my problem on the tags/tagname.

    I just followed the steps:
    1. Installed UTW and configured the tags/tagname structure.

    2. Updated the permalinks structure through the Option Tab.


    Comment by Gerard — 9/19/2007 @ 8:18 am

  19. MyAvatars 0.2

    I did same as comment #18. Works fine now. Thanks!

    Comment by Ryan — 9/24/2007 @ 11:05 pm

  20. MyAvatars 0.2

    I tried to post on UTW Webpage but my comment is awaiting moderation for 2 weeks so I thought maybe you could help me about it. Thx ^^

    Comment by haberler — 10/26/2007 @ 5:27 am

  21. MyAvatars 0.2

    I really admire the way you approach to tackle this matter which became a global issue . I will be observing your future works and submitting my own views and results of my personal researches

    Comment by nakliyat — 10/26/2007 @ 3:57 pm

Leave a comment

* Do not use spammy names!

RSS feed for comments on this post. TrackBack URI

RSS Feeds
Aug Sep Oct Nov
Jan Feb Mar Apr
Jan Feb Apr May
Jun Jul Aug Sep
Oct Nov Dec  
Jan Feb Mar Apr
May Jun Jul Aug
Sep Oct Dec  
Jan Feb Mar Apr
May Jun Jul Aug
Sep Oct Nov Dec
Mar Apr May Jun
Jul Aug Sep Oct
Nov Dec    
Jan Feb Mar Dec
May Jun Jul Aug
Sep Oct Nov Dec