How to Restrict Certain Usernames in Your WordPress Site ?

If your are using WordPress Mutisite or BuddyPress and you have kept user registration open for public (via Settings -> General -> Membership (“Anyone can register”) sometimes creates problems. By default all usernames (if they already not already registered) are allowed during WordPress user registration process.

If you like to restrict certain usernames from getting registered on your site then first of all install and activate Restrict Usernames plugin. If you are using WordPress Multisite then network activate it and follow these steps:

  • If you are using single WordPress install then visit Dashboard->Users -> Name Restrictions admin settings page and specify username restrictions.
  • If you are using WordPress Multisite then visit Dashboard->My Sites -> Network Admin -> Users -> Name Restrictions and specify username restrictions.

Now anyone attempting to register on your site chooses any restricted username will be seeing this message:

“ERROR: This username is invalid. Please enter a valid username.”

Remember: This plugin doesn’t put any restrictions on usernames chosen by admin himself while creating user accounts from within the WP admin dashboard.

Following are some common reasons why people wants to restrict certain usernames in WordPress:

  • Prevent usernames that contain foul, offensive, or otherwise undesired words
  • Prevent squatting on usernames that you may want to use in the future (but don’t want to actually create the account for just yet) (essentially placing a hold on the username)
  • Prevent official-sounding usernames from being used (i.e. help, support, pr, info, sales)
  • Prevent official username syntax from being used (i.e. if all of your administrators use a prefix to identify themselves, you don’t want a visitor to use that prefix)
  • Prevent spaces from being used in a username (which WordPress allows by default)
  • Require that a username begin, end, or contain one of a set of substrings (i.e. “support_”, “admin_”)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.