Introduction: Register Users For Specific Role
Welcome to another WordPress registration tutorial. Today, we will discuss how to register users for specific role on your site. If we wish to register users for specific role on WordPress site, the quickest way is to turn on Membership option inside Settings → General with checkbox labeled Anyone can register. If we look just below it, there’s a related option New User Default Role which allows us to define the role for any newly registered user (default role is Subscriber).
Once configured, publish a link to registration form on your site which will look something like this:
While this is serviceable, it obviously is not the prettiest or the most effective way to do things. The prebuilt roles of Author, Contributor, Editor and Subscriber are hardly sufficient for those who are not from web publishing industry.. Here are some of the unanswered questions:
1. What if we want to create and auto-assign a role not in the default WordPress roles list?
2. What if we want different registration forms for different User Roles?
3. What if we need users to chose their own role from a list authorized by us?
4. What if we do not want to show default WordPress registration form, which looks more a part of the dashboard and than our theme?
These few ‘what ifs’ certainly provide enough proof that WordPress’ out-of-the-box registration system is inadequate for most of us. Thankfully, the answer to all these (and more) is simple – RegistrationMagic!
Let’s go through the first scenario.
We need a user role, that does not comes with WordPress
Now you can create new user roles in a jiffy with RegistrationMagic’s baked in User Role Manager.
Next, click on User Roles in left menu and a new page greets us with a form and existing user roles below. This form is used for creation of new WordPress User Roles. There are 4 input fields:
Role Name is the name that’s displayed inside the dashboard. Display Name For Role is the name displayed on the front end. Remember, both can be same. Permission Level decides the editing rights to be copied from one of the default user roles. This is important and Subscriber is the safest option. Is Paid Role defines if the user will be charged for signing (this is exclusive to Silver and Gold Bundles and we’ll take it up in a different article).
Hit save and we’re all done here. You can assign new user role to any form in Form Configuration → Accounts Section.
The just created role will appear in the area below:
Please note that you cannot delete default WordPress User Roles.
Assigning different WordPress User Roles to different forms
This is easily done. Each form has individual Account settings. It means, you can attach each form to a different WordPress User Role. All we have to do is publish both forms on separate pages.
Allowing users to choose their own role
With RegistrationMagic, we can also provide the user a choice of specific roles. This is especially useful when we want to sign up more than one type of users. Although we definitely don’t want them to pick Administrator role! That’s why it is essential to configure allowed roles along with this option. We find that, again, inside Form Configuration → Accounts
Four (4) options control the behavior of such forms. Firstly, allow the form itself to register WordPress Users. Secondly, turn on the Users Pick Their Role. Thirdly, define the label of this field. And lastly, Check Allowed User Roles. In our example, we checked 2 out of available 7 user roles. Consequently, this is how the form appears to the user:
As we see, RegistrationMagic opens a world of possibilities when it comes to register user for specific roles on WordPress. This covers how you can register users for specific roles on your WordPress site. We’ll see you next time very soon. Cheers!
- How to add or update user profile fields using WordPress forms - August 5, 2020
- Boost RegistrationMagic User Profiles With ProfileGrid Integration - February 19, 2019
- WordPress Registration Shortcodes List - August 14, 2018
- Advance WordPress User Login Plugin Guide - August 8, 2018
- WordPress User Registration Status Guide - April 9, 2018
- Create Intelligent Contact Form in WordPress [Breakthrough Ideas] - February 8, 2018
- Setup payments on Registration form using Products [Payments Guide] - December 22, 2017
- Create Your First WordPress Registration Page – Starter Guide - November 14, 2017
- How to Add Custom Fields to WooCommerce Checkout Form - November 3, 2017
- Setup Early Bird Registration for an Event on WordPress Site, with Ease! - April 20, 2017