« Simple RSS Customizations | Main | Yearly Archives »

Technorati Tags and Movable Type

technorati-tags-banner.gif

Technorati, a leading blog search engine and index, has made it very easy for blog authors to get their "tagged" blog entries into Technorati's tag index. What is a tag? A tag is a type of category, and the process of tagging a simplified categorization method for your entries. The concept of tags has become popular with services such as del.icio.us and Flickr. By creating tag classifications for your weblog entries, you make it easy for Technorati to index your blog entries by tags that you specify. With Technorati tagging, you get to choose how you want your weblog entries to be classified, in contrast to algorithm-driven search engines like Google that make their own classifications based on what can be derived from the keywords in your text. Thus, people searching Technorati for weblogs having to do with will find blog entries in which the weblog author has categorized her entry as having to do with book reviews.

How to incorporate Technorati tags into your MT blog

First, Ping Technorati

There are several ways to incorporate Technorati tags into your Movable Type weblog. All methods require that you ping Technorati when you have saved a new entry. If you haven't already, you can set this up by going into your Weblog Config, Preferences section. Under "Publicity / Remote Interfaces / Trackback" select technorati.com as one of the sites to notify when you update your blog. Alternatively, your individual entries can ping Technorati by placing the Technorati ping URL - http://rpc.technorati.com/rpc/ping - in the URLs to Ping section of your Edit Entry screen and saving your published entry.

technorati-ping.gif

Create a link

The easiest way to create a tag that will be picked up by Technorati's tag index is to create a link in your entry body around a word that you would like to be made into a tag. For instance, if your entry is about "chickens", you could wrap a link around any instance of the word "chickens" in your entry body that would point to the Technorati index page for chickens.

Use the following tag convention:

<a href="http://technorati.com/tag/tagname" rel="tag">tagname</a>

like so:

<a href="http://technorati.com/tag/chickens" rel="tag">chickens</a>

So in your entry body, when you write about , the link is tagged back to Technorati (click on link to see example).

You can also tag multiple words, for example , like so:

<a href="http://technorati.com/tag/movable+type" rel="tag">Movable Type</a>

Technorati looks at the tags presented in the entries you show on the Main Index of your weblog. If you use extended entry sections that don't appear on the Main Index but continue over to an archive page, the tags in the extended section of your entry will NOT appear in the Technorati tag index unless you use the MT default atom.xml index template or take some additional steps to modify your atom template. The default atom template feeds the full entry body and extended entry. If you have changed your atom template so that the content section contains less than the full content of your post, , you should remove the <content type="text/html" mode="escaped" xml:lang="en" xml:base="<$MTBlogURL encode_xml="1"$>"> .....</content> section from the template, so that Technorati understands that the atom feed is only showing a summary, and won't index it as if it were a full article. Removing the content section will also instruct Technorati to look elsewhere for the full content of your weblog post.

Use default RSS and/or Atom templates

If you use an RSS 1.0 template, or the default RSS 2.0 or Atom templates that come with version MT3, and you use category archiving for your weblog, and you automatically ping Technorati when you update your site, Technorati will automatically find your feed and extract the primary category you have assigned your entry and turn it into a Technorati tag for that entry. Just make sure that you have the link rel="alternate" lines for those feeds that you use in the head section of your Main Index template. By default, those lines are the following:

<link rel="alternate" type="application/atom+xml" title="Atom" href="<$MTBlogURL$>atom.xml" />
<link rel="alternate" type="application/rss+xml" title="RSS 1.0" href="<$MTBlogURL$>index.rdf" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<$MTBlogURL$>index.xml" />

Adjust templates for multiple categories

If you assign multiple categories or subcategories to your entries, you can capture all of these categories as tags by following the instructions above for using the default RSS and Atom templates, and by making the following modifications to at least one of these templates:

For Atom 0.3

Replace <MTIfNonEmpty tag="MTEntryCategory"><dc:subject><$MTEntryCategory encode_xml="1"$></dc:subject></MTIfNonEmpty> with

<MTIfNonEmpty tag="MTEntryCategory"> <MTEntryCategories><dc:subject><MTParentCategories glue="/"> <MTCategoryLabel encode_xml="1"> </MTParentCategories></dc:subject> </MTEntryCategories></MTIfNonEmpty>

For RSS 1.0

Replace <dc:subject><$MTEntryCategory encode_xml="1"$></dc:subject> with

<MTEntryCategories><dc:subject><MTParentCategories glue="/"> <MTCategoryLabel encode_xml="1"> </MTParentCategories></dc:subject></MTEntryCategories>

For RSS 2.0

Replace <category><$MTEntryCategory removehtml="1" encodexml="1"$></category> with

<MTEntryCategories><category><MTParentCategories glue="/"> <MTCategoryLabel encode_xml="1"> </MTParentCategories></category></MTEntryCategories>

Add global tags to your blog

Let's say that your blog has a single theme, and you want every entry to be tagged with that theme. For example, if you have a cooking blog, it might be of more interest for you to have your entries tagged with "food" or "recipes" than with "appetizers" or "lamb". To do this, you need to first follow the instructions listed above for using the default RSS and Atom templates.

Note that you only need to adjust one of the syndication templates, not all three of them.

For Atom 0.3 and RSS 1.0

Wrap your global tags in <dc:subject> elements like so:

<dc:subject>tag-subject-1</dc:subject><dc:subject>tag-subject-2</dc:subject><dc:subject>tag-subject-3</dc:subject>

For example,

<dc:subject>recipes</dc:subject><dc:subject>food</dc:subject> <dc:subject>cooking</dc:subject>

Place this section at the channel level directly above your MTEntries section in your template.

For RSS 2.0

Wrap your global tags in <category></category> elements and place at the channel level directly above the MTEntries section in your template.

Turn keywords into tags - MT3.3

See the following LMT tutorial: Converting Keywords into Tags which uses a plugin by Hirotaka Ogawa.

Also see Jay Allen's Everybody Loves Tags overview of all the new tagging tags for MT3.3.

Turn keywords into tags - MT 3.2

There are several methods you can use to have the keywords you have entered into a keyword field for an entry transform automatically into Technorati tags. John of John's Jottings has written a simple Perl script which you can use in your templates if you have installed Brad Choate's PerlScript plugin. Other plugins are MTKeywordList and Technorati Tags from LaughingMeme, and TechnoratiTags plugin from 90% Crud. Six Apart has also released their Tags1 plugin which will turn all keywords entered into the keyword field into tags and at the same time into categories.

I have found the best solution to be a combination of Tim Appnel's mt-tagslite plugin used with MTGlue, and MTCompare.

To get mt-tagslite to parse keywords so that you can input keywords into the field separated by commas, and therefore capture keyword terms that have more than one word, you need to make some changes to the plugin file.

Change the following line (around line 60 or so) from:

@tags{ split( /\s+/, $k ) } = ();

which splits on whitespace to:

@tags{ split( /,\s*/, $k ) } = ();

which splits on a comma followed by an optional whitespace. (Thanks to Darren Chamberlain for the tip.)

You can then use the MTGlue plugin to insert commas into the display of the tags. And you can use the MTCompare plugin to only show the tag display if there are keywords in the field. For example, your code might look like this:

<MTIfNotEqual a="[MTEntryKeywords]" b=""> Technorati tags: <MTGlueContainer><MTEntryTags><$MTTechnoratiTag$><MTGlue>, </MTGlue> </MTEntryTags></MTGlueContainer> </MTIfNotEqual>

Many thanks to Niall Kennedy of Technorati for his suggestions and corrections with this tutorial. Thanks Niall!

Links:

Comments (9)

Steve:

I'm using the Tags1 plugin right now but how do I enter multiple word keywords? It splits everything up, for example the tag Live 8 creates pages for live and 8. Gizmodo.com has got it down, but how did they do it?

Yvette:

Thanks for this information.

Do any of these plug ins include the capacity to *display* your tags on your MT site, the way that they are displayed on Technorati?

wayan:

Woohoo! This was perfect! I too found the tagslite + a bit more option to work the best. Thanks so much.

wayan:

Actually, I may have jumped for joy a moment too soon. I am having trouble getting Technorati to recognize a tag where there is a space vs. a "+" between words in the href link. That or my RSS feed is jacked now that I added TTechnoratiTag to it.

What would be the code to add in a "+" between tag words (technorait.com/tag/Movable+Type for example) in the href link?

Hi Elise - thanks for this and all the other tips! I'm now on MT 3.32 which, as you rightly point out elsewhere, now conflicts with the mt-tagslite plugin. I've sort of got technorati tags working with the following ([ substituted for <):

[MTEntryIfTagged]Tags: [MTEntryTags glue=", "] [a href="http://technorati.com/tag/ [/MTEntryIfTagged]

Now this seems to be generating the links ok, but Technorati doesn't seem to be picking them up as tags. Any ideas? I did initially have them commented out, but in case that's the problem I'm going to have them displayed at the end of the post rather than the MT tag links.

Keep up the good work!

Hi Slowdown,
Make sure you have the tags before the "posted by" line in the HTML for the page, preferably on the Main Index template. I'm using a span class and CSS to make the tags invisible on my recipe site and it appears to be working.

Richard:

That's brilliant, Elise, will do - thanks!

Hello. I'm very new at this so please bear with my questions, I really need help. I followed the instructions above for turning keywords into tags for MT 3.2 and the tags are appearing on my main blog page, just above 'posted by'. I added the suggested code in my main index template.

Here are my questions:
1) do I need to add the code for 'Technorati tags...' in any other templates (master archive, category archive, date-based archive, individual entry archive, or any of the system templates)?

2) how can I make the 'Technorati tags...' invisible on my page?

I appreciate any help you can provide.

Hi Confused -

If you only added the tags to your main index, then that's where they will show. Similarly, if you want them to show on any other pages, you will need to add them to the other templates. In MT4, you can do this by editing the appropriate template (probably the Entry Metadata template module) and rebuilding your entire site - however, the plugins mentioned may not be compatible if you are using dynamic publishing.

As to making the tags invisible, you can either not add them - in which case they are not present (which isn't quite the same) or you can use CSS to change the display state.

Post a comment

(If you haven't left a comment here before, your comment may need to be approved before will appear on the entry. Thanks for waiting.)