Blog archive


Implementing Internet-Friendly Short URLs with WordPress

Peugeot 404 -- a symbol for linkrot?

Here at Nizomk Towers, we have been following, with keen interest, the conversations flying around teh internets about the perils of URL-shortening services, such as TinyURL et al. Apparently, with both the number of available URL-shortening services growing, along with the reliance on them, what we have is a ticking time bomb, just waiting to explode in our faces! Yikes!

As one Dave Winer so wisely puts it:

We need to prepare for the day when N of the URL shorteners go out of business. When that happens a large part of the web will die. It will not be a good day.

There have been various dialogues about what can be done to tackle the issue, one proposal is to place the responsibilty of URL-shortening firmly in the hands of the owner of the long URL, who would dutifully publish a shortened version using a common and, one hopes, widely-adopted convention. This would then be revealed in much the same way that RSS feeds are currently announced and discovered.

One very clever ‘short URL auto-discovery’ solution, rev=canonical, has been proposed and implemented by Kellan Elliott-McCrea, it’s not much more than a proof-of-concept at this stage, and would need widespread adoption to truly solve the issue, but we like the idea so much we thought we’d show our support by quickly throwing together a WordPress implementation and releasing it into the wild!

The source code for our plugin, wp_rev_canonical.php, is hosted on our GitHub repository, and our own beloved website (yes, the one before your very eyes) is already serving blog post pages with included shortened URL goodness, so now any service that supports it can publish our super-cute shortened URLs wherever needed.

For example, the shortened URL for this blog post is, this is broadcast by the following markup in the head section of this webpage:

<link rev="canonical" href="" />
<link rel="alternate shorter" href="" />

Ideally, of course, the shortened URLs would be served from an alternative, shorter, snappier, domain name, you might notice that ours sadly aren’t. We will be implementing this under our syllable-preserving pseudonym,, at the moment we are simply proving the concept, but hope to build on this in the not-too-distant future.

So, if your site is running WordPress, then you might like to download and install our plugin yourself, just grab it from GitHub, upload to your /wp-content/plugins/ folder, make sure your theme supports wp_head, enable it, and before you know it, Internet-friendly short URLs are your new best friend! Yay!

This post was filed under Social media, Training and tagged , , , , , , , , Comments are currently closed.


  1. Patrick Mays

    very cool! I guess all we need to do is set as an alias of in apache ideally it would 301 redirect to the correct url by checking what domain is being used :)

    Posted 8th April 2009 at 9:21 am | Permalink
  2. can I put in a vote for as the domain instead?

    Posted 8th April 2009 at 3:18 pm | Permalink
  3. I’ve got a plugin for serving shortened URLs from your WordPress install called ‘le petite url’, which you can check out here:

    I’ve seen a lot of support for rev=”alternate” lately, but I’m not sure if we’ll implement it yet.

    Posted 8th April 2009 at 5:59 pm | Permalink
  4. G’day,

    rev=canonical is a notoriously bad idea. Not only has “rev” been deprecated for HTML 5 (with good reason), but if users mix up rel and rev (as they already are) then they could do serious, permanent damage to their search engine rankings.

    “alternate” is also not appropriate because it refers to an alternate version of the *content* (e.g. PDF, text) – not the URL.

    Of all the short/shorter/shortcut/short_url/shorturl suggestions the only one that’s really got legs is “shortlink… you should see about implementing this instead.


    Posted 14th April 2009 at 11:28 am | Permalink
  5. Hi Sam, thanks for your comments. You’re right that support for the rev attribute in link elements is currently deprecated in HTML 5, however it’s worth pointing out that the HTML 5 spec is ongoing, and is not likely to be finalised for some time yet. I hope that, with support for rev=”canonical” ramping up across the Web, the HTML working group will consider re-introducing the rev attribute.

    Posted 14th April 2009 at 11:53 am | Permalink

4 Trackbacks

  1. By Short URLs with Wordpress at on 7th April 2009 at 6:21 pm

    [...] big thanks to Brighton-based NixonMcInnes for supplying a WordPress plugin that, with widespread adoption, would help ease the problem that would occur should one of the [...]

  2. [...] update: and so has Steve Winton [...]

  3. [...] Winer (via Steve Winton) has one possible [...]

  4. [...] (or ?p=1017) another WP plugin wp_rev_canonical.php which adds link elements for rev=canonical and for rel=alternate-shorter (i.e. rel=”alternate shorter”) [...]