Blog

Register users for specific role on your WordPress site

How to register users for specific role on WordPress site?

Register Users For Specific Role

In this article we will discuss how to register users for specific role on your WordPress 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).

Register User Role

Once configured, publish a link to registration form on your site which will look something like this:

sitename.com/sample-data/wp-login.php?action=register

Register users for specific role - 2

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 come with WordPress

Now you can create new user roles in a jiffy with RegistrationMagic’s baked in User Role Manager.

Register users for specific role

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:

Register users for specific role - 4

Role Key is the name that’s displayed inside the dashboard. Role Name is the name displayed on the front end. Remember, both can be same. Inherit Permissions decides the editing rights to be copied from one of the default user roles. This is important and Subscriber is the safest option. Sign-up Charge defines if the user will be charged for signing (this is exclusive to RegistrationMagic Premium 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 Dashboard → Accounts section.

The just created role will appear in the area below:

Register users for specific role - 5

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 Dashboard → Accounts

Register users for specific role - 6

Four (4) options control the behavior of such forms. Firstly, allow the form itself to register WordPress Users. Secondly, turn on the Allow Users Choice of Roles. Thirdly, define the label of this field. And lastly, check roles in Allow Role Selection From. In our example, we checked 2 out of available 7 user roles. Consequently, this is how the form appears to the user:

Register users for specific role - 7

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!

About RegistrationMagic

RegistrationMagic Editorial Staff (rmagic) is a team of WordPress registration experts and major contributor to the development of RegistrationMagic - WordPress User Registration Plugin.
Subscribe
Notify of
guest

2 Comments
Inline Feedbacks
View all comments
coimbatore architects
coimbatore architects
5 years ago

Hello! Would you mind if I share your blog with my myspace group?
There’s a lot of people that I think would really enjoy your content.
Please let me know. Many thanks

RegistrationMagic
RegistrationMagic
5 years ago

Yes, you may share the blog.