Standard" WordPress installation (without WooCommerce) I used a snippet like this one
function my_registration_errors( $errors, $sanitized_user_login, $user_email )
{
if ( strlen( $sanitized_user_login ) < 5 ) {
$errors->add( 'username_too_short', __( '<strong>ERROR</strong>: Username must be at least 5 characters.' ) );
}
return $errors;
}
add_filter( 'registration_errors', 'my_registration_errors', 10, 3 );
I tried WordPress Plugin Directory but It's not working.