Curly quotes and WordPress permalinks don't mix

Curly QuotesSometimes curly quotes get copied and pasted into the title of our blog and WordPress just can't handle it. The problem lies in the permalinks and manually editing the permalink to get rid of curly quotes fixes it (but what a pain). In my search for an automated solution I discovered no hooks into this aspect of WordPress and, therefore, no plugins that handle it.

The solution involves editing WordPress code. I'm not a fan of this and I wish there were another way, but if there is, I haven't found it.

This solution I discovered in a conversation that ericr23 had with himself.

Add this to sanitize_title_with_dashes in wp-include/formatting.php:


Permalinks sanitized! And we could all do with a little more sanitation, right? We could do with some more sanity too!

Leave a Reply

Your email address will not be published.