2

By default, Drupal 9 allows usernames to have spaces, periods(.), hyphens(-), apostrophes('), underscores(_) and @ symbols.

How would I disallow spaces, periods, apostrophes and @ symbols?

3

1 Answer 1

2

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.

2
  • There are also a LOT of other questions on here that ask the same or similar question. See the "Related" block to the right ->
    – anonymous
    Commented Feb 9, 2022 at 6:02
  • All of those questions are outdated or have nothing to do with the question of disallowing characters. I did search the website first before posting. Now admittedly, I didn't search "validation" when googling, which is probably why I didn't find the module that solved my problem.
    – cofihouse
    Commented Feb 9, 2022 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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