How to Allow User Role Selection at WordPress Registration - ProfilePress

How to Allow User Role Selection at WordPress Registration

In a previous post, we learned how to automatically assign specific roles to users depending on the registration form they signed up from.

In this article, you will learn how to allow user role selection from a dropdown by users at account registration or signup. Put simply as, allowing users to pick their roles on sign up.

Without further ado, follow the steps below to learn how to accomplish this.

Navigate to ProfilePress >> Forms & Profiles.

Create or edit an existing user registration form.

Add the role selection dropdown block or shortcode [reg-select-role] (if using the advanced shortcode builder).

You should now see it displayed in the registration form.

User role selection at WordPress registration

Note: by default, all user roles save for ‘administrator’ will be displayed in the dropdown. To restrict the selection to specific roles, add the roles as a comma-separated list to the block settings or as options shortcode attribute.

For example, say your website is a Job listing and you want to register users to indicate what account type they want by selecting either employer or candidate as their role. The following is how you will construct the shortcode.

[reg-select-role options="employer, candidate"]

For drag and drop builder, add the roles as options.

Finally, save the changes and you should see the user role dropdown displayed in your form.