Smart URLs in WordPress 2.5 +

I’ve discovered a couple of cool features of WordPress 2.5 lately. One of them is what I call “smart URLs”. I don’t know the official name of this feature, nor if this is really a feature or just an unintended side effect, but I love it.

You may have used URL shortening services like TinyURL.com or is.gd for compressing long URLs so they can be easily pasted into email or shared on Twitter (what with the 140-character limit). Even if you haven’t, you’ve probably wished at some point that the URLs of your blog entries could be shortened without losing their structure.

Well, with WordPress, you have URL shortening built in!

Consider the URL of the blog entry you’re currently reading:

http://manishjethani.com/blog/2008/07/08/smart-urls-in-wordpress-25/

If you simply strip out all the non-essential components, you end up with this:

http://manishjethani.com/smart-urls-in-wordpress-25

That isn’t short enough? Well, we can shorten it further by simply dropping words off the end of the URL:

http://manishjethani.com/smart-urls

… you can go all the way:

http://manishjethani.com/smart

All of the above URLs come back to this blog entry. I haven’t done any additional set up for this (like editing the .htaccess file); it just works out of the box!

These URLs persist even if I go on to make another post starting with the word “smart” (which I likely will) — it simply picks up the first one that matches.

This really works when you have a short domain name. As an example, here’s a smart URL that goes to an entry on Matt Mullenweg’s blog with some pictures from Milan:

http://ma.tt/milan

How cool is that?

One Response to “Smart URLs in WordPress 2.5”

  1. [...] how short URLs (“Smart URLs”), a new hidden feature in WordPress 2.5, can be used to create short urls. You may have used URL shortening services like TinyURL.com or is.gd for compressing long URLs so [...]