Using WP Post Slugs for True Permalinks
Alex and I had a IMversation the other day about an issue I’d run across: in WP v1.0.x, the options for cruft-free URL’s include:
- %year% — The year of the post, 4 digits, for example 2004
- %monthnum% — Month of the year, for example 05
- %day% — Day of the month, for example 28
- %postname% — A sanitized version of the title of the post. So “This Is A Great Post!” becomes “this-is-a-great-post” in the URI
- %post_id% — The unique ID # of the post, for example 423
An issue arises when someone wishes to change the title of the entry. An example is my Case for a Comment Registration System, which I have since realized is really better named a User Registration System. If I change the title, all existing permalinks—including TrackBacks I’ve made previously, which I cannot edit—die a horrible, nasty death.
As a permalink should be, well, permanent, this is bad.
WP 1.2, however, introduced the concept of the Post Slug. As the link notes, %postname% is now set to look for the Post Slug, rather than auto-sanitizing the title. [I haven't looked into the MySQL to see if this was actually being done in 1.0.x, but I'm guessing not.] If your permalinks are set to use the slug rather than the title, you’ll be able to change your title without killing inbound permalinks.
Beautiful, that.
Even more amusing, one could set the post slug to something completely unrelated [if one was of the mind to do so]. For instance, I could make this entry’s post slug “my left foot”, which would be amusing to me but not good for the reader trying to get context for the entry from its URL. [In my book, the context value of the URL’s naming scheme is important enough that you don’t want obfuscatory post slugs, but YMMV.
This functionality solves that problem, Alex.

Having just upgraded a few days ago, I just noticed the “post slug” this morning. Pretty slick.
May 27th, 2004 at 12:40WP 1.3+ Suggestion: Post Slug Locking and Required Titles
I’m prone to making suggestions about WordPress functionality, but I think these two are pretty important.
Lock Post Slugs after posting.
August 5th, 2004 at 16:21No one editing an already-published entry should be able to edit the post slug. The post slug is used to …
The Case for a User Registration System
August 6th, 2004 at 14:00There are many reasons to have a localized comment user registration system for Weblogs. The hottest topic at present is to have registration to keep lazy spammers out by raising the barrier to commenting from minimal to slight. I think that advocati…
Dude, I love your picture. Anyone who puts up a picture of themselves like that must be a cool guy.
February 13th, 2005 at 13:47