WordPress curlification of apostrophe in title

I was looking through Google Analytics to see how people found my site. I was checking out one of the queries when I noticed a weird behavior with regards to my blog title, Thu’s Blog. Basically, my blog did not rank for [thu's blog]. There were blogs that linked to my blog that were ranking for the query! My blog did rank for [thu blog] so it wasn’t being penalized. Looking at how Google bolded the queries in the title, I was able to narrow it down to a seemingly harmless character, the apostrophe.

It turns out that WordPress converts a straight apostrophe to a curly quote. Apparently, Google sees them as different characters so it affected my ranking. When people search, they’re going to use a regular apostrophe, not curly as in [thu’s blog].

So I searched around on how to prevent WordPress from converting the apostrophe in my blog title.

I found the hint here.

Specifically, open up wp-includes/default-filters.php. Then comment out the following line:

add_filter('bloginfo', 'wptexturize');

Update:

Three days after making the change, my blog is ranking #1 for [thu's blog] in Google. Yay! I think this shows that I wasn’t being delusional/egotistical in believing my blog should at least rank above the sites that link to it.

Update 2007-05-06:

When I upgraded to WP 2.1, the above change was overwritten and I didn’t bother to re-apply it. It hasn’t hurt since Google seems to handle it better now. :)

10 thoughts on “WordPress curlification of apostrophe in title”

  1. The best way to fix this is to do what WordPress itself does.

    Use the following code to get the blog title, instead of using just get_option(‘blogname’) or get_bloginfo(‘name’):

    wp_specialchars_decode(get_option(‘blogname’), ENT_QUOTES);

    This will ensure that the apostrophe special characters are reconverted back to the apostrophe before being displayed.

    Regards

    Vijay Padiyar

  2. I have a question on the single quote/apostrophe front, if anyone knows…

    On my site (http://www.runhundred.com) the search works fine–for the most part.

    But, if anyone searches for a post with an apostrophe (like Guess Who’s Coming To Dinner) the search not only fails to find the post, but also gets this error:

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource

    Any ideas on how to fix this?

Leave a 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>