How to restrict usernames in WordPress without a plugin

Here is a snippet that enables you to restrict certain usernames from being created by new users registering to your WordPress website.

Instructions
Add this code your theme function.php file.
*Remember to replace content of the “restricted array” with the usernames you want to restrict.

If you want to use a plugin to achieve the same functionality, you can use Scott Reilly’s Restrict Usernames WordPress plugin.

Comments

One Reply to “How to restrict usernames in WordPress without a plugin”

Leave a Reply

Your email address will not be published. Required fields are marked *