Restrict Usernames

Restrict Usernames

Wordpress plugin

Install on Wordpress

App Details

This plugin allows you to restrict the usernames that new users may use when registering for your site.

If open registration is enabled for your site (via Settings -> General -> Membership (“Anyone can register”)), WordPress allows visitors to register for an account on your blog. By default, any username they choose is allowed so long as it isn’t an already existing account and it doesn’t include invalid (i.e. non-alphanumeric) characters.

Possible reasons for wanting to restrict certain usernames:

  • 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 starts with, ends with, or contain one of a set of substrings (i.e. “support_”, “admin_”)
  • Require a minimum number of characters for usernames
  • Limit usernames to a maximum number of characters

When attempting to register with a restricted username, the visitor will be given an error notice that says:
ERROR: This username is invalid. Please enter a valid username.

NOTE: This plugin does not put any restrictions on usernames that the admin chooses for users when creating user accounts from within the WordPress admin. This only restricts the names that users choose themselves when registering for your site.

SPECIAL NOTE: Many membership plugins implement their own user registration handling that often bypasses checks (and hooks) performed by WordPress. As such, it is unlikely that the plugin is compatible with them without special plugin-specific amendments.

Compatible with Multisite and BuddyPress as well.

Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage

Hooks

The plugin exposes one filter for hooking. Typically, customizations utilizing this hook would be put into your active theme’s functions.php file, or used by another plugin.

c2c_restrict_usernames-validate (filter)

The ‘c2c_restrict_usernames-validate’ hook allows you to add your own customized checks for the username being registered. You can add additional restrictions or override the assessment performed by the plugin.

Arguments:

  • $valid (boolean): The assessment by the plugin about the validity of the username based on settings. True means username can be used.
  • $username (string): The username being registered.
  • $settings (array): The plugin’s settings.

Example:

/** * Add custom checks on usernames. * * Specifically, prevent use of usernames ending in numbers. * * @param bool $valid True if the username is valid, false if not. * @param string $username The username. * @param array $options Plugin options. */ function my_restrict_usernames_check( $valid, $username, $options ) { // Only do additional checking if the plugin has already performed its // checks and deemed the username valid. if ( $valid ) { // Don't allow usernames to end in numbers. if ( preg_match( '/[0-9]+$/', $username ) ) { $valid = false; } } return $valid; } add_filter( 'c2c_restrict_usernames-validate', 'my_restrict_usernames_check', 10, 3 ); 

Pricing

Starting from $0 per month.

Check Out the Bluesky Feed Widget

By Common Ninja

Bluesky FeedTry For Free!

App Info

Rating

Reviewers

14 reviews

Tags

registration
restrictions
signup
username
users

Developed By

Scott Reilly

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Bluesky Feed for Wordpress logo

Bluesky Feed

Show Bluesky posts with a Bluesky feed that updates in real time, improves content discovery, and keeps visitors engaged with fresh activity.

Vimeo Carousel for Wordpress logo

Vimeo Carousel

Show Vimeo videos with a Vimeo carousel that displays clips in a smooth, flexible layout to boost visibility and engagement.

Poll for Wordpress logo

Poll

Create interactive polls with a poll widget that gathers real time feedback, boosts engagement, and helps you understand visitor opinions quickly and clearly.

Reddit Feed for Wordpress logo

Reddit Feed

Show Reddit posts with a Reddit feed that updates automatically, improves content discovery, and keeps visitors engaged with fresh discussions.

Stories for Wordpress logo

Stories

Add interactive stories to your site to showcase content in a visual, mobile friendly format that boosts engagement and guides visitors toward action.

Card Slider for Wordpress logo

Card Slider

Showcase content with a card slider that presents images, text, and buttons in a smooth, customizable layout to keep visitors engaged.

Spinning Wheel for Wordpress logo

Spinning Wheel

Add an interactive spinning wheel to offer prizes, capture leads, and drive user engagement through gamified rewards.

Info List for Wordpress logo

Info List

An Info List presents key details in a clear, structured format to improve user experience and support conversions.

Ratio for Wordpress logo

Ratio

Create interactive infographics with a ratio widget that uses custom icons, dynamic tooltips, and clear visuals to help visitors understand data quickly.

Bracket Maker for Wordpress logo

Bracket Maker

Bracket generator for creating interactive tournaments that organize matchups, track progress, and deliver a clear and engaging competition experience.

Card Builder for Wordpress logo

Card Builder

Add customizable content cards to your site to display structured information clearly with flexible layout and design options.

All in One Reviews for Wordpress logo

All in One Reviews

Display and manage customer reviews from multiple platforms in one place to build trust and highlight brand credibility.

More plugins

plugins You Might Like

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms