Tags! They’re everywhere! It seems like every site on the ‘net is adding tagging now. Tag clouds — ridiculous, pointless, and annoying — are not the reason. Tagging is a good way to get into Technorati and a good way to get more traffic to your site. It’s a nifty way to organize your posts and to help your readers find what they want on your site. Is it the wave of the future? I don’t know. I don’t think so. Several of the early adopters are now saying that they are useless, and the search engines seemed to be doing a fair job of indexing blogs long before people got tag-happy. But it’s not exactly terribly painful to add this functionality to your site — it only took me about a half hour, so how hard could it be? Plus you’ve got me to explain it all to you.
This how-to assumes that you’re using WordPress to manage your blog. If you are using something else — blogger, MovableType, etc. — then you’ll have to look somewhere else. Technorati is a good place to start.
Adding Tags to Your WordPress Blog in Six Easy Steps:
- If you’re not using WordPress 2.04 (or better), upgrade.
- Make a backup of your .htaccess, index.php, single.php, and archive.php files!
- Grab Bunny’s Technorati Tags plugin. Unzip the plugin and upload it to your wp-content\plugins folder. Activate Bunny’s plugin from the WordPress Administrator Plugins tab.
- We’re going to edit bunny-tags.php because there’s really no reason to send all your visitors to Technorati. Instead we’ll make your tags search your own site for related posts. In the output_bunny_tags() function, change:
$tag_link='<a href=”http://technorati.com/tag/’ . rawurlencode($tag) . ‘” title=”‘ . __(‘See the Technorati tag page for’, ‘BunnyTags’) . ‘ \” . $tag . ‘\’.” rel=”tag”>’ . $tag . ‘</a>’ . $separator;
to
$tag_link='<a href=”http://www.yourwebsite.com/tags/’ . urlencode(urldecode($tag)) . ‘” title=”‘ . __(‘Search this site for’, ‘BunnyTags’) . ‘ \” . urldecode($tag) . ‘\'” rel=”tag”>’ . $display_tag . ‘</a>’ . $separator;
- Go to the WordPress Administrator Manage Files tab and add this line to your .htaccess file:
RewriteRule ^tags/([^/]+)$ /index.php?s=$1 [R]
- Add this line somewhere to your index.php, single.php, and archive.php templates:
<?php the_bunny_tags(‘Tagged with: ‘, ”, ‘, ‘); ?>
There you go. Now you’re good to go. Your “Write Post” page will now include a new field you can use to enter tags specific to each post. Bunny’s plugin stores the tags in the WordPress wp_postmeta table.
Enter the tags with spaces between each one. If you have a multi-word tag, like “banana split”, use %20 or the plus symbol (+) for the space character. So for “banana split” you’d enter “banana%20split” or “banana+split” (without the quotes). I think that you can edit the plugin to allow you to use a comma as a separator by changing the value of $bunny_strict, but I haven’t tried this.
Ello,
I came across your post via Technorati. I loved the simplicity of Bunny’s Tags but it lacked a few options I was looking for (like tag configuration!) so I ended up writing my own tagging plugin.
It’ll automatically attach your tags at the end of posts and freeds so there’s no need to edit themes. It also has a configuration panel in WordPress so you don’t have to edit the plugin to change something like the way tags are displayed. And hey, it’s also compatible with Bunny’s tags as that’s the plugin I started with!
If you feel like checking it out it’s here; http://www.andrewgrant.org/keyword-tags Lemme know what you think!
Cheers,
Andrew