By default, Drupal 9 allows usernames to have spaces, periods(.), hyphens(-), apostrophes('), underscores(_) and @ symbols.
How would I disallow spaces, periods, apostrophes and @ symbols?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityBy default, Drupal 9 allows usernames to have spaces, periods(.), hyphens(-), apostrophes('), underscores(_) and @ symbols.
How would I disallow spaces, periods, apostrophes and @ symbols?
I used the Username Validation module suggested by Patrick Kenny in his comment. The Blacklist characters field shown by the module on /admin/config/people/user-name-validation did the trick.