WordPress.org

Ready to get started?Download WordPress

Forums

Quotes in URLs (7 posts)

  1. nickaster
    Member
    Posted 5 years ago #

    Hi all. The more I think about this, the more I see it as a bug in the software.

    Context:
    http://wordpress.org/support/topic/297263?replies=12#post-1171388

    If a writer uses quote marks or apostrophes in a title, then the permalink URL that's created actually includes quotes or apostrophes. That's really bad URL formatting and although they seem to work, causes problems if you want to share posts. Plus it looks really ugly.

    I'm curious as to why WP allows this at all, and whether I'm just one lone guy freaking out about it. Seems like common sense that the "pretty url" feature should strip anything other than alphanumeric characters.

  2. design_dolphin
    Member
    Posted 5 years ago #

    Seems like common sense that the "pretty url" feature should strip anything other than alphanumeric characters.

    As far as I know it does normally. Or it should(?).

    Works fine on my site, see for example:
    http://www.ecodelphinus.com/chronisch-zieken-en-gehandicapten/techniek/data-entry-errors-zoek-resultaat-in-pubmed-central-pmc.html

    And always has actually.

    Just using standard permalinks code:
    http://codex.wordpress.org/Using_Permalinks

    So not sure what is going on.

  3. nickaster
    Member
    Posted 5 years ago #

    Woah. Now that's very interesting. So there's definitely something wrong with mine. THanks for that info!

  4. nickaster
    Member
    Posted 5 years ago #

    Incidentally, I figured it out - it's those damn "smart quotes" that MS word created. Authors had been using it and copying and pasting headlines into WP. If you avoid smart quotes it works fine.

  5. design_dolphin
    Member
    Posted 5 years ago #

    Thank you for posting the cause and the solution. :-)

    P.s:
    I am not sure if you are allowed to use the word d**n in the forum.

  6. nickaster
    Member
    Posted 5 years ago #

    well, the use of that word was polite considering how I feel about MS word :-)

    I suppose I should leave it up to WP to find a way to fool-proof it if people paste in from MS word or another smartquote source.

  7. design_dolphin
    Member
    Posted 5 years ago #

    I suppose I should leave it up to WP to find a way to fool-proof it if people paste in from MS word or another smartquote source.

    Not sure if it is possible to do so. Although you might be able to write some kind of php code for a field form which would strip the characters, or a plugin which does the same thing. Just strip everything except plain text. However you would have to preserve (single) quotes, spaces, dashes, and parentheses (and possible other things as well).

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.