Shorter Link: A rev=canonical WordPress plugin

Hot on the heels of my No DiggBar, I've created another extension for WordPress!

Shorter Links provides a <link> tag in the <head> section of your page with a shorter url and appropriate tags for use with the new revCanonical system. Further details can be found at laughingmeme.org, shiflett.org or benramsey.com.

The link created looks like this:

By default, the shorter url is simply {your domain}/{post id}, but the plugin also creates a custom field called "Shorter link" once a post is saved, so that you can change the shorter link to a more memorable set of characters.

Rather handily, Simon Willison, has produced a bookmarklet called Shorten so you can find out if the page you are looking at has a shorter link or not.

As an example, my Zend Framework Tutorial page has a canonical URL of http://akrabat.com/zend-framework-tutorial. I have set up a Shorter Link of http://akrabat.com/zft which will redirect to the correct page. The <link> tag for this is:
<link rev="canonical" rel="alternate shorter" href="http://akrabat.com/zft" />

Why not download Shorter Links and have a play?

Update, the latest version uses rel="shorturl".

13 thoughts on “Shorter Link: A rev=canonical WordPress plugin

  1. Seeing as the majority of my websites are run on WordPress, this is a great plugin that I'll be sure to implement.

    rel=canonical seems to have exploded in the last week and make perfect sense with micro-blogging becoming a mainstream standard.

  2. FWIW, I personally prefer a rel="" attribute, but at the end of the day, I'll go with whatever is decided upon as long as it doesn't have a dash or underscore in it!

    Regards,

    Rob…

  3. There are two sources of confusion (outside of rel vs rev which is the most dangerous): underscores vs dashes vs spaces and uri vs url.

    rel="shortlink" avoids both types.

    Sam

  4. Well done Rob, I was just about to build one myself but it seems you beat me to it.

    I think it would be interesting though if we can somehow integrate the option to specify your own shorturl domain like Simon Willison did his swtiny.eu domain. Do you think this would be possible?

  5. +1 for specifying a short domain :)

    Oh it seems I forgot to mention you need to drop "alternate" because you're not providing an alternate version of the *content*.

    Also a PURL has been allocated for rel=shortlink (http://purl.org/net/shortlink) so you can use it to be standards compliant while we wait for it to be formalised.

    Sam

  6. Yeah – I'll learn how to do WP plugin admin pages and sort out the short domain thing.

    Will lose alternate too.

    I wonder what the final decision on the rel attribute's name is gonna be. I suppose I could just do rel="short shorter shorturl shortlink" and not worry about it :)

    Regards,

    Rob…

  7. I've given you committer access on the "shortlink" plugin too – hoping we can get some consolidation going on here at some point so as not to confuse the hell out of users.

    Re: short/shorter/shorturl/shortlink *none* of them are standards compliant, which is why I created http://purl.org/net/shortlink while pushing shortlink through the standards process (e.g. Atom and HTML – I'm an invited expert on HTML 5 at W3C so I'll see about what's involved in getting it introduced).

    short (one of my original suggestions) and shorter are both adjectives and it's not clear whether they apply to the content itself or the link – that basically rules them out.

    shorturl is both easily confused with shorturi and short_url (a previous iteration). Furthermore the guys at shorturl.com have (and assert) common law trademark rights in it.

    shortlink is a no brainer but some people (for whatever reason) are still pushing broken alternatives – especially RevCanonical which is fundamentally flawed.

    Sam

  8. Err, I've just finished patching your plugin to allow users to specify the base url, didn't realise someone else had suggested it already!

    Email me if you want it Rob.

Comments are closed.