Mastering WordPress: A Step-by-Step Guide to Restrict Usernames and Emails

restrict-usernames-in-wordpress

Want to stop users from using certain usernames and email addresses when registering? Follow our tutorial and learn how to restrict usernames in WordPress.

During our business operations, we observed that some users registered with inappropriate usernames. Some included offensive language, while others used trademarked terms, and a few even imitated official-sounding names.

This not only caused confusion but also introduced potential security vulnerabilities.

If you allow user registrations on your website, you may encounter similar challenges. Therefore, it is essential to manage the usernames and email addresses that users can register with.

In this guide, we will explain how to restrict usernames and email addresses for users in WordPress.

Why Should You Restrict Usernames and Emails in WordPress?

If you operate a WordPress membership or community site, you will need to enable user registrations. This allows new users to choose any username and email address during signup.

This means users could select usernames that resemble those of administrators, moderators, and support staff. They might even impersonate a member of your team, which poses a security risk for your WordPress site.

Additionally, they could register with offensive or trademarked terms when creating an account on your WordPress site.

Restricting subscribers from using specific words in their usernames and email addresses is essential. This practice helps eliminate inappropriate language and upholds the quality of your forums and communities.

Let’s explore how to set limitations on usernames in WordPress.

The Simplest Method to Limit Usernames and Email Addresses in WordPress

To effectively prevent certain words and phrases in usernames, consider using the Restrict Usernames Emails Characters plugin.

This free WordPress plugin enables you to restrict specific usernames, email addresses, symbols, domain names, and more. It also provides an option to allow characters from specific languages, such as Latin, Arabic, Cyrillic, or any other language.

First, install and activate the Restrict Usernames Emails Characters plugin. If you need assistance, refer to our guide on how to install a WordPress plugin.

Once activated, navigate toSettings » Restrict Usernames Emails Charactersin your WordPress dashboard. Open the ‘General Settings’ tab to confirm that the plugin is enabled.

Next, scroll down to the ‘Not allow these names’ section within the plugin and input the words or phrases you wish to restrict from being used in usernames.

The plugin includes an option to treat lowercase letters as equivalent to uppercase letters. This feature is enabled by default, but you can turn it off using the dropdown menu.

You can also block specific email addresses from being used.

In the ‘Disallowed Emails’ section, simply input the email addresses that you want to restrict for user registrations. This will help eliminate spam and ensure users provide valid email addresses.

Additionally, the plugin offers customizable settings for username and email restrictions.

For example, you can block certain email domains, restrict usernames that contain specific words, prohibit the use of certain characters and symbols that WordPress typically allows, and permit special characters.

There are also options to limit spaces in usernames, prevent usernames from consisting solely of numbers, disallow uppercase usernames, and more.

Remember to click the ‘Save Changes’ button once you have finished making your adjustments.

Next, navigate to the ‘Error Message’ tab within the plugin.

The plugin comes with default pre-written error messages for various scenarios, but you can modify any of these messages in this section.

If a user attempts to register with a restricted username or email address on your WordPress site, they will receive an error message and will need to choose a different username and email.

This is how our demo website displayed the error when we tried to register a user profile with a restricted email and username.

Explore Additional Methods to Enhance Your WordPress Security

In addition to limiting usernames and emails in WordPress, there are numerous other strategies to enhance your website’s security. For instance, you can prevent users from registering with temporary email addresses.

Many individuals have misused temporary email addresses to create fake accounts, take advantage of free trials, or deceive online systems for malicious purposes.

You might also consider blocking specific IP addresses from accessing your site. This is an effective measure against comment spam, email spam, hackers, and various security threats.

Here are additional guides you may find helpful for securing your website:

  • How to Restrict WordPress Pages Based on User Role
  • How to Limit Content Access to Registered Users in WordPress
  • How to Restrict Authors to Their Own Posts in the WordPress Admin Area
  • How to Limit Authors to Specific Categories in WordPress
  • How to Limit WordPress Forms to Registered Users Only
  • How to Prevent Specific Email Addresses from Being Used in Your WordPress Forms
  • How to Create a Basic User Password Generator in WordPress

We hope this guide has helped you understand how to restrict usernames in WordPress. You might also be interested in our recommendations for the top user management plugins for WordPress and our guide on enabling users to toggle password visibility on the WordPress login page.

If you enjoyed this article, please subscribe to our YouTube Channel for WordPress tutorials. You can also connect with us on Twitter and Facebook.

Share This Post