Score:2

How would I disallow special characters in usernames?

tr flag

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

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

cn flag
Maybe [User Name Validation module](https://www.drupal.org/project/username_validation) or [User Restrictions module](https://www.drupal.org/project/user_restrictions) can help.
tr flag
Thanks Patrick. Looks like the User Name Validation module does exactly what I need.
cn flag
Great. If it works for you, feel free to answer your own question with the details of how you configured the module.
Score:2
tr flag

Used the Username Validation module suggested in Patrick Kenny's answer. Simple configuration of the 'Blacklist Characters' field at admin > configuration > people did the trick!

fr flag
There are also a LOT of other questions on here that ask the same or similar question. See the "Related" block to the right ->
tr flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.