Fix username illegal characters in WordPress (Chinese, Japanese or Korean letters)

Fix username illegal characters in WordPress (Chinese, Japanese or Korean letters)


Fix username illegal characters in WordPress (Chinese, Japanese or Korean letters)

Here is how to fix username illegal characters in WordPress (Such as Chinese, Japanese or Korean letters)

By default WordPress does not allow users to enter special characters in usernames. Non-Latin characters are silently filtered out and your users cannot create accounts containing Chinese, Japanese or Korean letters.

For example, if Japanese character are entered in the username field, the following error message appears:

► Error: Please enter a username.
► Error: This username is invalid because it uses illegal characters. Please enter a valid username.

► Use this code :

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);
}

#wordpresstutorial
#wordpresstips
#wordpressfreecourse


Content

2.48 -> hi wordpress users
4.799 -> do you want to register users in
6.319 -> wordpress with japanese or chinese
8.24 -> language
10 -> default wordpress does not allow users
12.32 -> to enter special characters and
13.84 -> usernames
17.26 -> [Music]
19.359 -> non-latin characters are silently
21.279 -> filtered out and your users cannot
22.96 -> create accounts containing chinese
24.88 -> japanese or korean letters
28 -> for example if japanese character are
30.32 -> entered in the username field the error
32.32 -> message appears
33.87 -> [Music]
36.8 -> to allow users to use non-latin letters
39.12 -> in the username field
40.879 -> you need to follow some instruction
43.68 -> note that do not experiment on your live
46.079 -> website please first test on your
48 -> staging site
50 -> so first install and activate code
52.399 -> snippets plugin in your wordpress site
57.94 -> [Music]
70.08 -> now go to snippets menu and click add
72.4 -> new
74.479 -> next write a title and paste our code in
76.96 -> your snippets and choose only run an
78.88 -> administration area option
86.4 -> now click the save and activate button
89.04 -> that's it
93.79 -> [Music]
97.52 -> you can create user in the japanese or
99.759 -> chinese language anytime let's see
103.25 -> [Music]
116.159 -> so thank you so much for watching if you
118.799 -> like this video please subscribe to our
121.2 -> channel to get more update on wordpress
123.439 -> tutorials and technical demos

Source: https://www.youtube.com/watch?v=zWMUMpP5ngQ