Radioactive Jam

I hope to make feiends with you!

Wordpress backslash fix

Posted by RaJ on June 13th, 2006

Warning: this post is narrowly and completely geek-oriented. Feel free to disregard, or ignore, or whatever. Simply put, this is a mercy post. If I can help even one person avoid the hours of fruitless searching I endured, that’ll be good. (And if that’s why you’re here and you’re in a hurry, here’s the fix I found; stop back some other time, eh?)

Update: yet another stable, “recommended” official release - version 2.0.4 (available here) - is out, seems to (1) address the problem noted in this post, and (2) eliminate the need for this workaround. 2.0.4 might do a few other good things too. Probably. As the saying goes, “works for me.”

The WordPress team recently released a stable, “recommended” update, version 2.0.3. Bug fixes, security updates, easy install & upgrade - the usual. I like to keep up so I applied the update, no problem - as usual. Then I started noticing some not-so usual quirks.

WordPress makes it easy to edit things like comments and links, and sometimes I need to do so. The new version added an “are you sure?” screen - aka AYS - to the edit process. Okay, mildly annoying but I’ve seen worse. Then I noticed if the link or comment text contained an apostrophe / single quote i.e. ‘ or a quotation mark - ” - once I edited it, WordPress added a backslash (also known as an “escape” character) to each and every one. So a phrase like:
life’s little “surprises” became:
life\’s little \”surprises\”

And I found no acceptable way around it. Quoting one of my favorite books, “I do not like this, Sam-I-Am.” So I started my quest to Solve This Problem. Hey - internet, right? Search engine! Right! And the 28,000 hits for WordPress and backslash - that’s a relatively small number.

Anyway. After examining many irrelevant web pages and pointlessly burning a support ticket with the hosting company - another story, some other time - I managed to hit the right keyword combo on the WordPress site, and found my way to this page, which has clear instructions and a downloadable “tune-up” plug-in to fix several annoying bugs lurking in version 2.0.3. Including the ones bugging me. Woohoo!

Okay let’s “review” to make sure I used all the right keywords, so some future searcher might find this page instead of 28,000 less-helpful others: WordPress version 2.0.3 bug glitch quirk edit comments links php backslash escape apostrophe single double quote quotes quotation AYS confirm annoying pizza Doctor Frank Enstine monkeys clowns freakout radioactive jam gratuitous Tom Cruise l0ser snails Anti-RLI voices in my head… okay we’re good.

P.S. Yesterday I noticed a similar bug in a non-essential part of “Horde” the webmail client. Finding and solving that one is left as an exercise for the über-geek(s).

PS2 (Is that you, Sony? Ha! Ha-ha!) - today I got my invite for Google Analytics. So they must be nearing the bottom of the pickle jar, mangling metaphors all the way down. The end.

12 Responses to “Wordpress backslash fix”

  1. Syar Says:

    but why would they add the back slashes in the first place? I mean, what’s the logic?

    and lol, Jam, on the PS2 joke. :-) It elicited a few chuckles.

    and real Radioactive Jam (I just typed Ham, before I realized my mistake. that has never happened before) Google analytics maps! WOOHOO!

  2. Syar Says:

    oh, and dibs and all credit for the blob over malaysia. I’m willing to share the credits with nadia, but no one else.

  3. Lianne Says:

    Hey! I got my invite too! We are in SUCH a Geek-Club. And I use WordPress… not sure I love it. Would love to find the do-hinkey that lets me align images in a paragraph. Do you know that one, oh, WPG?

  4. omar Says:

    I’m so bitter about how long I had to wait for an Analytics invitation, now they’re sending ‘em out rapidfire now. But I still love you, Google.

  5. RaJ Says:

    Syar, it’s a script-parsing thing. Apostrophes and quotes are special, “live” characters within scripts. An escape character - in this case a preceding backslash - tells the script processor to treat the following character as ordinary text. And I’ll let you explain “blob” honors to Nadia.

    Lianne, I’ll check to see if that’s in my bag of tricks. Haven’t tried doing anything clever with photos and paragraphs in a long time.

    Omar, maybe you could make it one of those back in the day things like walking to school barefoot through snow. Me, I’m still laughing about the “five million pageviews” notice.

  6. k-RaD Says:

    You got invites? ::pouts:: Drat.

    Also, I like the PS2 joke. But only caught on to it once I reached Syar’s comment. Aha. Ha. Thanks S-RaD.

  7. Michael M. Says:

    This post turned up at the top of my googling. I installed the pluging, and it fixed the problem. Thanks.

  8. RaJ Says:

    Cool! You’re welcome, and thank *you* for letting me know.

  9. unitstep.net Says:

    Wordpress 2.0.3 “tuneup”…

    I recently updated to WordPress 2.0.3, basically as soon as I noticed it was available. It was touted as a “security fix” release, so I thought it would be a good idea to upgrade ASAP. However, it introduced a few bugs, that while not ext…

  10. Psychochild Says:

    You succeeded in your quest. After a fruitless search on the Wordpress site, a Google search came up with this page. It fixed the exact problem I was having. Kudos, you’ve earned at least a little bit in the bank of Karma. ;)

  11. Daniel Says:

    Thank you for the Google juice… I had the same problem!

  12. mykrocosm » Blog Archive » Upgraded to 2.0.4 Says:

    […] I’m sure you saw a few ’ scattered across my blog lately. That was so irritating. This backslash would get added to every apostrophe I typed. And these annoying “Are you sure : Yes No” pages that never really explained what I was confirming? What’s up with that? Turns out it was a dodgy bug in Wordpress 2.0.3. I found a patch for it but decided to upgrade instead. Yay! All sorted. […]