WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am from Turkey and we have "şŞçÇğĞüÜöÖıİ" characters in our alphabet.

I want to use those characters in permalinks/slugs/usernames. I found temporary solution for permalinks/slugs with core-hacking. There is no other option for it except core-hacking seems. You can find solution here:


My problem is, user registration need a little fix after this one too. Fortunately there is filter i can use but couldnt handle it:

in wordpress includes/formatting.php :

function sanitize_user( $username, $strict = false ) {
 $raw_username = $username;
 $username = wp_strip_all_tags( $username );
 $username = remove_accents( $username );
 // Kill octets
 $username = preg_replace( '|%([a-fA-F0-9][a-fA-F0-9])|', '', $username );
 $username = preg_replace( '/&.+?;/', '', $username ); // Kill entities

 // If strict, reduce to ASCII for max portability.
 if ( $strict )
  $username = preg_replace( '|[^a-z0-9 _.\-@]|i', '', $username );

 $username = trim( $username );
 // Consolidate contiguous whitespace
 $username = preg_replace( '|\s+|', ' ', $username );

 return apply_filters( 'sanitize_user', $username, $raw_username, $strict );

This section of code is producing error:

 if ( $strict )
  $username = preg_replace( '|[^a-z0-9 _.\-@]|i', '', $username );

Somehow i need to disable this section. But i am not sure how to do it.

share|improve this question
Mighty good question, This problem is not only in Turkey. It is basically in every European language which is not English. Come to think about it - the problem exists for every language in the world that is not English ! ( Chinese, Japanese, Korean, Arab, Hebrew , Hindu ... basically 2/4 of the world population ... ) – krembo99 Dec 31 '13 at 14:47
@krembo99 I created plugin for this purpose: wordpress.org/plugins/wordpress-turkce You can inspect and modify it for your language too – Ünsal Korkmaz Dec 31 '13 at 15:49
up vote 2 down vote accepted

Try this (not tested, I hope I am not short circuiting it into endless loop):

add_filter('sanitize_user', 'non_strict_login', 10, 3);

function non_strict_login( $username, $raw_username, $strict ) {

    if( !$strict )
        return $username;

    return sanitize_user(stripslashes($raw_username), false);
share|improve this answer
after long long searches, seems its not something supported in php community yet.. unicode permalinks basically what i want seems.. I have an ideas page about it: wordpress.org/extend/ideas/topic/non-latin-characters-need-love – Ünsal Korkmaz May 14 '11 at 13:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.