What are the Discourse rules for usernames?

Hello, please can someone point me in the direction of the rules for usernames? I’m trying to establish if ampersands and apostrophes are allowed or not but I cannot find anything in here that helps me. Many thanks.

2 Likes

Welcome, @abi_at_work!

An easy way to answer your question empirically is to go to try.discourse.com and see what usernames you can create there!

If you want to know exactly, you can look at the code:

https://github.com/discourse/discourse/blob/master/app/models/username_validator.rb

5 Likes

No, it is not possible to use & or ' in a username. If a user attempts to signup for a Discourse site with one of those characters in their username, they will see the following message ( must only include numbers, letters, dashes, dots, and underscores):

7 Likes

Thank you @pfaffman I couldn’t tell if it was configurable or not, but it seems not which would explain why I couldn’t find it. Thank you for the reply.

I thought it might be able to be done in the Allow username Unicode Characters bit of the set up

1 Like