The Restrict Usernames Emails Characters plugin is the best approach to prevent the usage of particular words and phrases in usernames. It’s a free WordPress plugin that lets you limit usernames, email addresses, symbols, domain names, and other things. The plugin even allows you to utilize a certain language, such as Latin, Arabic, Cyrillic, or any other language.
From your WordPress dashboard, go to Settings » Restrict Usernames Emails Characters after activation. Make sure the plugin is activated in the ‘General Settings’ page.
After that, go to the plugin’s ‘Not allow these names’ area and insert terms or phrases to prevent them from being used in usernames.
In the plugin, there’s also an option to make lowercase equal uppercase.’ It will be enabled by default, but you can turn it off from the dropdown menu.
You can also restrict specific email addresses from being used.
Simply input the email addresses that users cannot use when registering in the ‘Not allow these emails’ area. This will aid in the detection of spam emails, and users will be required to use their real email addresses.
Aside from that, the plugin includes further customizable settings for username and email address restrictions.
You can, for example, prohibit the use of specific email domains, limit usernames that contain specific terms, avoid using letters and symbols that WordPress allows, and enable special characters.
There are other options to limit the use of spaces in usernames, prevent users from using only digits in their usernames, and prevent uppercase usernames, among other things.
When you’re finished, remember to click the ‘Save Changes’ option.
Then, in the plugin, go to the ‘Error Message’ tab.
By default, the plugin comes with pre-written error messages for various scenarios. This area, on the other hand, allows you to modify any error message.
If someone tries to register for your website using a limited username and email address, they’ll get an error message and will have to choose another username and email address.
When we tried to register using a restricted username and email address on our demo website, this is what it looked like.