Natural Search Blog

Tagging WordPress Pages with Ultimate Tag Warrior

I’ve blogged before about the SEO benefits of tagging blog posts. For those bloggers using WordPress, I recommend the Ultimate Tag Warrior plugin to accomplish this.

But what if you have a WordPress-powered site and you want to tag static Pages, not just Posts? Well I have some good news! Even though Ultimate Tag Warrior doesn’t currently support tagging of Pages, I managed to figure out a workaround. The hack (to version 3.14159 of the plugin) involves the addition of a mere two lines of code…

First, add after line 1551 of ultimate-tag-warrior-core.php:
$request = preg_replace("/ AND post_status != 'static'/","", $request);

Second, and add after line 819 on ultimate-tag-warrior-actions.php:
add_action('edit_page_form', array('UltimateTagWarriorActions','ultimate_display_tag_widget'));

The first line modifies the MySQL select statement that specifically excludes static pages.

The second line adds the tag field to the Write Page form.

I’ve communicated this hack to Christine Davis, the author of the UltimateTagWarrior plugin. Happily, she said she will look at adding it to the next version. :-)

UPDATE: This hack has made it into the latest version of UTW. Unfortunately, the hack doesn’t work with WordPress 2.1. So if you’re running WP2.1, tagged static pages don’t show up on tag pages. That’s because the WordPress developers switched to using post_type = ‘page’ for static pages. So I got it working by putting the following into line 1564 in ultimate-tag-warrior-core.php (version 3.1415926 of UTW):
$request = preg_replace("/post_type = 'post'/","post_type = 'post' OR post_type = 'page'", $request);

9 comments for Tagging WordPress Pages with Ultimate Tag Warrior »

  1. MyAvatars 0.2

    The Bunny Technorati Tags plugin supports pages and posts as well for those already not using Ultimate Tag Warrior. So Does SimpleTags I believe, but I don’t like its implementation as much.

    Comment by Marios Alexandrou — 12/14/2006 @ 6:16 am

  2. MyAvatars 0.2

    Stepahn, Thanks for the info-I’m passing this on to my web guru!

    Comment by Steve Mertz — 12/18/2006 @ 3:30 pm

  3. MyAvatars 0.2

    Thanks for this. Just what we were looking for!

    Comment by yellow — 1/4/2007 @ 11:22 am

  4. MyAvatars 0.2

    Hi! Why I can’t fill my info in profile? Can somebody help me?
    My login is Kisakookoo!

    Comment by Kisakookoo — 1/23/2007 @ 1:05 pm

  5. MyAvatars 0.2

    Havn’t tried it yet, but just what I looked for so thanks for sharing…

    Comment by Peter Giger — 1/25/2007 @ 9:21 am

  6. MyAvatars 0.2

    Thank you for your workaround, it works perfect!

    Comment by majlath — 2/4/2007 @ 9:08 am

  7. MyAvatars 0.2

    Unfortunately this doesn’t work with UTW 3.141592 and WP 2.1.2?

    Comment by Anne Helmond — 3/23/2007 @ 3:31 am

  8. MyAvatars 0.2

    Any workarounds to WP2.1.2 and this code? I’ve tried it and it doesn’t work…

    Comment by Adeel Amin — 4/12/2007 @ 2:58 pm

  9. MyAvatars 0.2

    Second that, still in 2.1.3 doesn’t work at all, any solutions?

    Comment by Carlos — 5/7/2007 @ 11:45 am

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