Update: I have added support for alpha-numeric shortlinks. See the plugin docs for how to enable that.
Numeric Shortlinks is a WordPress plugin that enables shortened URLs out of post IDs. It is a very simple plugin (only 28 lines) that hooks into the pre_get_shortlink filter and doesn’t have any configuration options.
That’s kinda awesome. I guess a step beyond that, would be to convert the numbers into a combination of letters and numbers. That way you would be able to use a character or two less.
Yeah, I really don’t like those lowercase, uppercase, number things in URLs for various reasons. However, I should probably add a filter or two to allow that kind of extension. This is a great thread on theory behind a mapping function like that.
That’s a bit different as the method used in that link involves storing the short URL. I’m suggesting that the short URL could be in an a-z+0-9 format, but calculated based on the ID. So there’d be some sort of algorithm which was able to convert from a standard base 10 numerical format into something utilizing the whole alphabet.
I’m not sure it’s worth the effort, but just thought I’d mention it since it’s the first thing I thought of when I saw the plugin.
Check out the accepted answer where the guy suggests doing exactly what you said. Mapping base 10 IDs to [a-z0-9] minus the confusing characters like 0, O, l, I, etc.
Oops. I didn’t even realise that’s what he was meaning in the answer.
i noticed a redirect loop if you hook into the post_link filter, so you can have the shortlink show up instead of the real permalink without editing the template code.
any idea around this redirect?