Why don’t WordPress post slugs allow accents?

If you create a post whose title has an accent in it and some other unicode character in it, eg à 漢語 title thing, its slug (permalink) will become a-漢語-title-thing… ie, the à was converted into a regular a, but those unicode Chinese characters were left intact.
Why doesn’t WordPress leave the accented characters alone?
I created a code snippet to tell WordPress to leave them alone

function mn_sanitize_title($modified_title, $original_title, $context)
{
// the $modified_title may have had accents removed, but not the $original_title
return $original_title;
}
// set this filter to run BEFORE WP already ran the title through `sanitize_title_with_dashes`
add_filter(‘sanitize_title’, ‘mn_sanitize_title’, 5, 3);

and it seems to work fine (accented characters are left intact in post slugs) so I’m wondering why WordPress developers removed accented characters from post slugs in the first place?

Read more here:: Why don’t WordPress post slugs allow accents?

Leave a Reply

Your email address will not be published. Required fields are marked *