Sometimes, when building a website on WordPress, you want to allow your users to select their own user roles when registering their accounts. However, by default, WordPress doesn’t ship with this feature natively.
Why Enable User Role Selection on Registration?
Think about a school trying to onboard its staff onto their intranet website. Obviously, you want the staff members to access only specific areas on the website. The easiest way to control this access on a WordPress website is by using user roles.
Then again, it would be too much work to manually assign each user to their appropriate user role. An easier way would be to allow each user to select their own user role during sign up.
In this blog post, I’ll show a simple yet useful plugin that allows user role selection at sign up, especially for membership websites such as schools.
Understanding WordPress User Roles
When it comes to creating a dynamic and interactive website, WordPress stands as a top choice. User roles in WordPress play a crucial role in defining the access and capabilities of each user on your website.
However, one of the biggest limitations has always been the inability for users to choose their own roles during registration. Instead, users are typically assigned a default role, which may not always align with their intended use of the website.
How to Enable User Role Selection on Sign Up
There are various ways to achieve enable user role selection during registration, but my favourite method is using the WP Roles at Registration plugin by NetTantra. However, this plugin was recalled from the WordPress repository a few months ago (see screenshot)
Luckily, we can still download WordPress plugins, even if they are not publicly available in the plugin directory. All we need to do is find the plugin slug and add the URL prefix “https://downloads.wordpress.org/plugins/…”.
In this case, the plugin slug is “wp-roles-at-registration“, and so to download the plugin, just go to this link https://downloads.wordpress.org/plugins/wp-roles-at-registration.zip and voila!
Once you have the plugin, simply install and activate it on your website. Then head over to Settings and enable the user roles you want to make available during registration. If you want to add more custom user roles, you can use the members plugin to achieve this.
Final Words
Allowing WordPress users to select their desired user roles during account registration is extremely useful in streamlining the onboarding process and ensuring that everyone has the right level of access and privileges from the get-go.
Hope this guide helps you in some way 🙂
See Also: How to Allow Users to Switch User Roles in WordPress