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 Responses to “Shorter Link: A rev=canonical WordPress plugin”

  1. 1 Si Jobling

    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. 2 Rob...

    Si,

    It's now even easier as I've put it onto the WordPress Plugin Directory: http://wordpress.org/extend/plugins/shorter-links/

    Also, it's rev not rel as the shorter link is a reverse canonical link - i.e. points back at the canonical one.

    Regards,

    Rob...

  3. 3 Sam Johnston

    Good to see we've already got rel/rev confusion :P

    Anyway, I've migrated your code to use "shortlink" and added it to Googel Code at http://code.google.com/p/shortlink/ (still need to test it but want to get something done for Drupal too).

    Cheers,

    Sam

  4. 4 Rob...

    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...

  5. 5 Sam Johnston

    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

  6. 6 Cristiano Betta

    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?

  7. 7 Sam Johnston

    +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

  8. 8 Rob...

    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...

  9. 9 Sam Johnston

    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

  10. 10 Sam Johnston

    Oh and I'm working on a formal specification for shortlink too at http://code.google.com/p/shortlink/wiki/Specification

    You've got write access on this and you're already acknowledged here: http://code.google.com/p/shortlink/wiki/Acknowledgements

    Sam

  11. 11 Dave Marshall

    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.

  12. 12 Cristiano Betta

    Interesting to see the rapid development in 1 day :D

  13. 13 Rob...

    No doubt it'll slow down shortly!

    Rob...

The views expressed in these comments are not the views of the publisher. However, we believe in the rights of others to express their legitimate views and concerns. Any legitimate complaint emailed to rob@akrabat.com will be seriously considered and the post reviewed as desirable and necessary.

Leave a Reply

Buy now!