Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Restrict Usernames and User Emails in WordPress

One thing we noticed while running our business is that some users were registering with questionable usernames. Some contained foul language, others used trademark words, and a few even mimicked official-sounding names.

This not only created confusion but also posed potential security risks.

If you allow people to register on your website, you might face similar issues. That’s why it’s crucial to have control over the usernames and email addresses users can register with.

In this article, we’ll show you how to restrict usernames and user emails in WordPress.

Restrict usernames in WordPress

Why Restrict Usernames and User Emails in WordPress?

When you are running a WordPress membership website or a community website, you’ll need to allow WordPress user registrations. When you do, new users can pick any username and email when they sign up.

That means that users can pick a username similar to the admins, moderators, and support staff. They could even pretend to be a member of your team, leading to a WordPress security risk.

Not to mention, they could also use offensive words or trademark words when registering a user account on your WordPress website.

That’s why it’s best to restrict subscribers from using certain words in usernames and email addresses. It prevents the use of foul language and helps maintain high standards on your forums and communities.

Let’s see how you can limit usernames in WordPress.

The Easiest Way to Restrict Usernames and User Emails in WordPress

The best way to prevent the use of certain words and phrases in usernames is by using the Restrict Usernames Emails Characters plugin.

It’s a free WordPress plugin that allows you to restrict certain usernames, email addresses, symbols, domain names, and more. The plugin even offers an option to allow the use of a certain language, like Latin, Arabic, Cyrillic, or any language.

First, you’ll need to install and activate the Restrict Usernames Emails Characters plugin. If you need help, then please see our guide on how to install a WordPress plugin.

Upon activation, you can head over to Settings » Restrict Usernames Emails Characters from your WordPress dashboard. Open the ‘General Settings’ tab to ensure that the plugin is enabled.

Make sure the plugin is enabled

After that, you can scroll down to the ‘Not allow these names’ section in the plugin and enter words or phrases to restrict their use in usernames.

There’s also an option to ‘make lowercase equal uppercase’ in the plugin. By default, it will be enabled, but you can disable it from the dropdown menu.

Enter names to restrict username

Similarly, you can also prevent the use of specific email addresses.

Under the ‘Not allow these emails’ section, simply enter the email addresses that users can’t use when registering. This will help filter out spam emails, and users will have to use their actual email addresses.

Not allow certain emails

Besides that, there are optional plugin settings to customize the restrictions on usernames and email addresses.

For instance, you can prevent the use of certain email domains, restrict usernames containing certain words, avoid the use of characters and symbols that WordPress permits, and allow special characters.

There are even options to limit the use of spaces in usernames, not allow users only to use numbers in the username, stop uppercase usernames, and more.

Prevent the use of space and numbers in username

Don’t forget to click the ‘Save Changes’ button when you are done.

Next, you can go to the ‘Error Message’ tab in the plugin.

The plugin will already have pre-written error notifications for different situations by default. However, you can customize any error message in this section.

Edit error messages

Now, if someone tries to enter a restricted username and email address when registering for your WordPress site, they’ll see an error message and will have to pick another username and email.

Here’s what it looked like on our demo website when we tried to register for a user profile using a restricted user email and username.

Error message when restricted username is entered

Learn More Ways to Secure Your WordPress Site

Besides restricting usernames and emails in WordPress, there is a lot more you can do to keep your website secure. For example, you can block users who register an account using temporary email addresses.

Many users have abused temporary email addresses by creating fake accounts, exploiting free trials, or tricking online systems for harmful purposes.

You may also want to block certain IP addresses from accessing your website. It’s an effective way to deal with comment spam, email spam, hackers, and other security threats.

Here are other guides you may want to check out to secure your website:

We hope this article helped you learn how to restrict usernames in WordPress. You may also want to look at our expert picks of the best user management plugins for WordPress and our article on how to allow users to hide or show passwords on the WordPress login screen.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

2 CommentsLeave a Reply

  1. David

    too but it isnt working anymore

    • David

      Sorry, just to update, it does work, unfortunately I tested with a front-end login/administration plugin and this is why I didnt see it working.

      How can I implement it to a custom front-end login/registration plugin?

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.