I’m using custom permalinks “/%category%/%postname%/”. Whenever a post title contains quotes or apostrophes they appear in the URL.
Can someone tell me how prevent them from appearing in the slug?
I am running WordPress 3.0.4.
I’m using custom permalinks “/%category%/%postname%/”. Whenever a post title contains quotes or apostrophes they appear in the URL.
Can someone tell me how prevent them from appearing in the slug?
I am running WordPress 3.0.4.
You must be logged in to post a comment.
In WordPress, “—” and ” — ” become em-dashes (—
—
) and “–” becomes an en-dash (—#8212;
). The sanitize_title_with_dashes() function doesn’t catch these.That function uses the databased copy, but the title displayed to the user always goes through a texturize function. So if we replace en/em dashes on their way into the database, the net result will be the same and avoid these bad URL cases the titles are re-texturized.
I’ve seen there are some plugins to work around this problem. Check Clean URL for example: