Eric Scouten
RSS
  • Home
  • Blog
  • About Eric
  • Contact
  • Site Credits

Home  ➤  Blog  ➤  Blogging  ➤  WordPress  ➤  WordPress Anti-Pattern: Don’t Remove Trailing Slashes in URLs
Lightroom Technique: How I Organize My Catalog and Why Lightroom 2.2 Is Out!

WordPress Anti-Pattern: Don’t Remove Trailing Slashes in URLs

December 15, 2008 · 5 Comments · In WordPress

I’ve had an unusual burst of inbound links to this site lately, and it just occurred to me last night that there are no visible trackbacks or pingbacks.

Hmmm. After temporarily changing themes, temporarily disabling plug-ins that might interfere with trackbacks and comments such as Akismet (which is absolutely wonderful, BTW!) and No Self Pings, I eventually stumbled upon the real cause:

My custom permalink structure lacked a trailing slash.

I turned on trailing slashes (i.e. back to the traditional year/month/post-name pattern), and life is good. It would have been nice if The Google had known about this, or if WP had contained a warning to that effect. Since it didn’t, I’ll share it here to save the next person some pain.

So, to be clear: Don’t do this:

Do this instead:

(These screen shots are from WP 2.6.5 under Settings > Permalinks.)

If you enjoyed this article, please consider sharing it!
RedditFacebookTwitter

5 Responses to WordPress Anti-Pattern: Don’t Remove Trailing Slashes in URLs

  1. Claude says:
    December 16, 2008 at 5:34 am

    It’s a bad idea to leave out a trailing slash for directories because it forces a redirect (HTTP status code 301), which adds a delay to the user’s experience. This could be what you identified as “an unusual burst of inbound links.”

    See Avoid Redirects here.

    Reply
  2. Eric says:
    December 16, 2008 at 9:54 am

    Understood, but you’ve actually hit on the key misconception I had. I never thought of the individual post page as a directory. And there’s precedent for that: Look at the screen shots I posted above, specifically the “Numeric” version. There’s no trailing slash in “/archives/123″.

    By “unusual burst of inbound links,” I meant actual, valid inbound links from other sites, as indicated by the Google Blog Search in the Dashboard. So there really are pingbacks that are missing because I had a faulty URL scheme.

    Reply
  3. Poe Jea says:
    February 19, 2009 at 6:34 pm

    What exactly is the problem? The lack of the last slash makes it appear as if the site was linked to too many times? (i.e. a user on some other site clicked on the link like 10 times?

    What do we do if we MUST have the link with no slash at the end? I really hate the slash and want it off so it will look better.

    Thanks!

    Reply
  4. Eric says:
    February 19, 2009 at 9:33 pm

    @Poe: The problem is that WP constructs an invalid trackback URL, so your trackbacks get silently dropped on the floor.

    I don’t particularly care for the trailing slash either, but it seems like you have to decide between that and having trackbacks.

    (I’m not part of the WP development team; I’m just reporting what I’ve found from my own experience.)

    Reply
  5. Poe says:
    February 19, 2009 at 9:54 pm

    cool, thanks the info. :)

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Home
  • Blog
  • About Eric
  • Contact
  • Site Credits

About Eric

Hi, I’m Eric. I’m a photographer, blogger, and software developer based near Seattle, Washington. I’ve been creating great software for desktop computers since 1983 and great photography since 1993.

Since 2003 I’ve combined those interests as a member of the Adobe Lightroom and Adobe Revel development teams.

Popular Articles

These articles in my Lightroom Technique series have been especially popular:

  • How I Organize My Catalog and Why (2009 Edition)
  • Staying Organized with Controlled Vocabulary
  • Smart Collections and Worklists

Categories

  • Blogging (3)
    • WordPress (3)
  • Family (1)
  • Gadgets (3)
  • It Just Works (3)
  • Lightroom (9)
  • Mac Software (8)
  • Mobile Phones (7)
  • Photography (10)
  • Travels (15)
  • Uncategorized (5)
  • Web Development (2)
  • Web Services (1)

Archives

  • January 2012 (1)
  • September 2011 (1)
  • November 2009 (1)
  • October 2009 (1)
  • September 2009 (1)
  • May 2009 (1)
  • April 2009 (1)
  • February 2009 (2)
  • January 2009 (1)
  • December 2008 (2)
  • October 2008 (2)
  • August 2008 (2)
  • July 2008 (3)
  • January 2008 (1)
  • November 2007 (2)
  • September 2007 (2)
  • August 2007 (3)
  • September 2006 (1)
  • August 2006 (9)
  • July 2006 (3)
  • June 2006 (1)
  • January 2006 (1)
  • September 2005 (1)

Follow Me On …

  • 500px
  • Flickr
  • Google+
  • Facebook
  • Twitter
  • LinkedIn
  • RSS feed