Jan 28, 2026 11:21 pm
Is there no character limit for usernames during registration? I tried 40 characters and it registered. Probably even more. This is a big problem. I think it's possible to register with a 100-character username.
2 Replies
Jan 29, 2026 6:44 am
Hi,
User registration and account creation are part of the WordPress core. wpForo only provides the registration form with different design and URL.
This is a native WordPress function, so you should look for a solution in WordPress itself.
Try searching for something like: “limit username in WordPress registration”.
Jan 29, 2026 10:28 am
I solved the problem.
The limit is set to a minimum of 3 and a maximum of 15 characters. You can change this if you wish. Add this to the functions file:
add_filter('registration_errors', function ($errors, $sanitized_user_login, $user_email) {
$length = mb_strlen($sanitized_user_login, 'UTF-8');
if ($length < 3 || $length > 15) {
$errors->add(
'username_length_error',
'Kullanıcı adı 3 ile 15 karakter arasında olmalıdır.'
);
}
return $errors;
}, 10, 3);