Jump Menu : Content | Explore | Comments | Search | Home | Sitemap | Contact | Login | Access.

WordPress Lessons Learned, Part 1: Permalink Structure

While planning my current site renovation project, I considered changing the format of my permalinks. Reasons for modifying the permalink structure of a site include:

  • Optimizing URLs for the search engines
  • Simplifying URL structure for improved readability
  • Removing the implication that your site content is somehow organized chronologically
  • Removing other unwanted organizational implications (e.g., categorically, topically, etc.)

Like many people who configured WordPress permalinks a couple of years ago, I chose to include the day, month, and year along with the blog URL and post title. For over two years now, Perishable Press has employed the following permalink format:

http://perishablepress.com/press/2007/11/05/sample-post/

..which is dependent on the following code structure:

/%year%/%monthnum%/%day%/%postname%/

At the time, this was the widely accepted and most popularly employed format for permalinks. Much of what we now know about search engine optimization, duplicate content, and canonicalization has changed the way many think about their permalinks. These days, the optimal way of writing your WordPress URLs represents a return to simplicity, readability, and a “flat” directory structure:

http://perishablepress.com/press/sample-post/

..which is dependent on the following code structure:

/%postname%/

This is the new format that I have been craving. It’s clean and crisp and represents my current mindset perfectly well. Nonetheless, after contemplating the various benefits, I considered the potential downsides to changing my permalink format:

  • Loss of link equity due to broken links, 404 errors, and other redirection nightmares
  • unnecessary confusion from missing content and broken links inflicted upon site visitors
  • Unforeseen conflicts with WordPress 2.3 and other scripts, plugins, and themes
  • Need for secondary set of htaccess rewrite rules

Clearly, plenty of great reasons either for or against such a drastic move. Finally, while comparing the options and considering a final decision, I decided to take a few steps back and look at the “big picture” for a moment: is it really necessary to change the format of permalinks this late in the game? No, it is not. A tighter permalink structure may prove beneficial according to several of the reasons previously outlined, but the potential drawbacks associated with permalink modification are not worth the risk. At the end of the day, the permalinks for this site, although dated (pun intended), are well-established and happen to work just fine. Although it would be a complete bonus and possible benefit to restructure my permalinks at this point, I see no long-term benefit to a simplified format. In fact, in the long run, say after another five or ten years, this site will house a virtual ton of content and may very well benefit from the current permalink structure.

As many of us know, permalinks require Apache’s mod_rewrite module and involve various rewrite directives, and an htaccess file. If you have ever experimented with various htaccess tricks, you totally understand the highly sensitive and volitile nature with which they operate. htaccess is powerful stuff — messing with a well-established permalink structure requires modifying htaccess rules, and should be approached with great care and understanding. This is not meant to scare anyone from trying to reformat their permalinks, it is merely a reminder that “if it ain’t broke, don’t fix it,” and, “if it is broke, make sure you know what you’re doing before making any changes.”

Allow me to conclude with a word of advice to new bloggers out there who may be establishing the structure of their own permalinks. If I could go back and begin Perishable Press with the knowledge I have gained over the past two years, I would have went with the simplest format possible. In other words, my permalinks would look something like http://perishablepress.com/sample-post/ and that’s it. Including the date string (e.g., /2007/07/07/) in the URL is unnecessary because WordPress inherently organizes your content chronologically. Organizing and displaying your content chronologically is your choice, however, once you decide to include the date in the URL, there is no (easy way of) going back. Likewise, including the post categories in your permalinks cements each category permanently, making it much more difficult to rename or remove it in the future.

Regardless of the permalink structure you decide to use, I highly recommend planning as far into the future as possible and/or necessary. If you have any intention whatsoever of continuing your site for any serious amount of time, it behooves you to contemplate your site as it may exist “x” number of years from now. For example, are you absolutely certain that you will never want to change your categories? Which permalink format affords the greatest degree of flexibility? Factoring such considerations into your decision-making process will serve you well regardless of where your blog ends up.

Related articles

About this article

This is article #431, posted by Perishable on Monday, November 05, 2007 @ 09:14am. Categorized as WordPress, and tagged with links, mod_rewrite, permalink, tips, url, WordPress. Updated on April 06, 2008. Visited 15345 times. 6 Responses »

BookmarkSubscribeExplore

« An Inside Look at the Hectic Schedule of an Internet Addict • Up • Site Overhaul, Phase Two: Switching Default Theme »


6 Responses

1 • November 6, 2007 at 5:01 am — Stephen Cronin says:

I agree - if I had my time over I’d go with just postname. There are plugins (such as Deans Permalink Migration) which can redirect the URLs for you if you do change your permalinks, but I’m of the “if it ain’t broke, don’t fix it” school of thought as well. I don’t think the small benefit is worth the risk.

Also, I totally agree with you that people should be careful about using category in permalinks. It means you can’t tweak your category structure without breaking your permalinks. Also, if you accidently post using the wrong category, changing it to correct category will break the permalinks created by your pings.

Great post and clear thinkng…

2 • November 6, 2007 at 9:46 pm — Perishable says:

Yes indeed, well said: “if it ain’t broke, don’t fix it” — so true. Of course, if there are clear and measurable benefits, there are many methods of implementing permalink changes. There are plugins (as you mention), PHP techniques, htaccess tricks, and even hardcore database alterations that may be employed. For a newer blog, changing permalink structure may be worthwhile, as the total number of redirects is relatively few. On a site such as this, however, there are nearly 400 posts, a handful of pages, and several other bits and pieces that would, I’m afraid, leave me and my site in utter ruins if even the slightest glitch reared its ugly head.

Also, you article mentions the potential cons for using only %postname% in permalinks. I have read the reports of this on several occasions but have never encountered a real-life situation in which any such issue occurred. Of course, anything is “theoretically” possible, but I don’t believe the hype, personally. I have seen and worked with far too many sites that employ postname-only permalinks with great success to believe otherwise.

One more point before I dive back into the site redesign: some people will argue that using only %postname% for the permalink structure causes problems if two (or more) posts happen to have the same title (Happy Halloween, et al). This is also nonsense because WordPress automatically appends a dash-numeral to the end of any duplicate post slugs. So, for example, a second post entitled “Congratulations” would appear as this in the permalink:

http://your-site.com/congratulations-2/

Well, that’s enough rambling for me — time to get back to work on the site! — Cheers ;)

3 • November 6, 2007 at 10:11 pm — Stephen Cronin says:

Yes, just using %postname% is no longer a problem. One of the commentators states that the problem the Codex mentions was fixed in WordPress 1.5! There are many people using this permalink structure and no hints of any problem. As you say there’s no problem with duplicates. If I was starting a new blog, I’d just use %postname%.

Good luck with the work on your site. It looks great!

4 • February 10, 2008 at 8:30 am — Scott says:

how about %postname%.html . would that help SEO and user legibility as well. setting up a site right now…

thanks!

5 • February 10, 2008 at 4:51 pm — Perishable says:

As far as I know, search engines in general do not place greater ranking preference on pages referenced via file names (e.g., ../postname.html) as opposed to those linked via some sort of “pretty permalink” (e.g., ../postname/). This is one of those weird SEO myths that continues to persist. Feel free to use the format that best suits your needs! — Best of luck with your new site, btw! :)

6 • February 10, 2008 at 11:24 pm — Scott says:

thanks and thanks :) I’ve been building static sites and using .html for so long it’s like seeing a sentence without punctuation to not have a file extension, and even a final / still seems a bit lonely out there. I did follow your advice and just went went with %postname% and edited my slugs as well to make them meaningful for SEO. I’m bit late to Word Press so luckily I can benefit from others’ hard learned lessons.

Drop a comment


Set CSS to lite theme
Set CSS to dark theme