Forums

Getting Rid of "Smart Quotes" (17 posts)

  1. nickaster
    Member
    Posted 2 years ago #

    I'm having alot of problems with quotes and aprostrophes in headlines getting translated into bad code - They seem to get turned into ugly ASCII code in my RSS feeds, and worse, they actually get incorporated in to URLs sometimes.

    I've tracked this problem down to "smart quotes". I thought the problem was people cutting and pasting from MSWord, but I've seen the problem happen when headlines are just typed in normally.

    Is there a way to just kill them alltogether?
    Is there a way to make the RSS feed smarter so it doesn't display gobbledy gook in people's RSS readers?

    Thanks!

  2. songdogtech
    Member
    Posted 2 years ago #

    Look at your page source and see if there's junk around the headlines. The plugin Unfancy Quotes should override smart quotes, but you still must be getting them from MS Word.

  3. nickaster
    Member
    Posted 2 years ago #

    Thanks!

    Check this page out:

    http://www.triplepundit.com/2009/09/rosabeth-moss-kanter-speaks-about-valuecorp/

    It's obviously got smart quotes in the headline (you can see it in the source). The thing is, I wrote that headline myself and didn't go anywhere near MS Word or any other editor. I just typed those quotes directly into the title field.

    How in the world did that happen? Is it the browser? (Chrome and FF both show fancy quotes to me on PC)

  4. NDP
    Member
    Posted 2 years ago #

    Looks fine to me.

  5. nickaster
    Member
    Posted 2 years ago #

    Yeah, the page looks fine, but you can see in the source code that "smart quotes" are in there. In some RSS readers this makes the headline look like junk. I'm trying to figure out how smart quotes got into the headline just by typing the headline into the title field - I never touched MS word.

  6. SpankMarvin
    Member
    Posted 2 years ago #

    In your wp-includes folder, there is a file called formatting.php. I am sure that the replace function is in there somewhere, because I removed the curly quotes once from a troublesome site. I'm afraid I can't remember where in this file it is, though! Anyone?

  7. songdogtech
    Member
    Posted 2 years ago #

    Try using the HTML entities in your post instead of the actual quote mark; they should render OK in a feed and show as curly quotes in HTML. See reserved characters in HTML.

    for a left quote, use   «
    for a right quote, use    »
  8. nickaster
    Member
    Posted 2 years ago #

    Thanks guys.

    It's not practical to ask my authors to use the HTML, there's too many and they'll never understand or remember.

    Is this behavior normal? Or is something wrong with my install? If I mess with formatting.php, is that a dangerous hack?

    Thanks!

  9. nickaster
    Member
    Posted 2 years ago #

    Guys - are "smart quotes" supposed to happen in headlines or not? I keep seeing them find their way in and I am NOT using microsoft word. Is this normal behavior or not?

  10. songdogtech
    Member
    Posted 2 years ago #

    Are smart quotes in your headlines all the time, on every headline? If so, they must be in your theme.

  11. nickaster
    Member
    Posted 2 years ago #

    Yeah, they seem to always be there. Had no idea such a thing was possible in a theme. Do you know how one would begin to look for such a thing? I want to at least get rid of them in headlines.

  12. songdogtech
    Member
    Posted 2 years ago #

    Look for quote marks around the post/page title block, which is usually something like:

    <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
  13. nickaster
    Member
    Posted 2 years ago #

    Thanks. Sorry I misunderstood... no, quotes are only in headlines if people type them in.

    I did a little experiment and added quotes around a word in a recent headline, then loaded the page up and, sure enough, they turn out as smart quotes. Is this happening in the browser? Is it possible that there's something clever in the theme that I haven't found?

    Thanks!

  14. songdogtech
    Member
    Posted 2 years ago #

    Try these html entities in a test post and see if they come across OK in a feed. Then delete the post.

    for a left quote, use   &laquo;
    for a right quote, use    &raquo;
  15. malcolmcoles
    Member
    Posted 2 years ago #

    Nick - I understand where you're coming from. WordPress was turning my quotes into smart quotes - not in the URL but in the HTML title, which was mucking up how they appeared in google.

    For instance, if someone searched on "I'm blah blah etc" then, if a page of mine that had I'm in the title was in the results, the I'm wouldn't be bolded because of the smart quotes.

    Anyway, the solution is to turn off the wptexturise filter. See the first answer here for how to do that:
    http://forum.bytesforall.com/showthread.php?t=2932

  16. malcolmcoles
    Member
    Posted 2 years ago #

    If it helps, I wrote up the similar problem I was having and some instructions on my own blog:
    http://www.malcolmcoles.co.uk/blog/wordpress-smart-quotes

    There's also an example of how smart quotes can cause you problems in google's results.

  17. Baden
    Member
    Posted 1 year ago #

    malcolmcoles solution of removing the wptexturise filters worked great on my end. thank you internets.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.