Blog

How to Restrict WordPress Forms by User Roles

Restrict WordPress Forms by User Roles with RegistrationMagic

“User Roles” play a huge part in any WordPress environment. Essentially, there are five default user roles in WordPress, with each having their own specific set of permissions. The administrator has the maximum authority among all the roles. In order to decide which user role can access which form, one must restrict WordPress forms by user roles. Eventually, this will give a boost to your WordPress form security as well.

RegistrationMagic is one such plugin that allows user to access forms depending on their WordPress user roles. In this tutorial, we will discuss how you can restrict WordPress forms by user roles in online forms.

Read More.
How to restrict WordPress registrations by age and other parameters

Navigate to “Access Control” on your WordPress form

Go to the RegistrationMagic menu from your dashboard. Then, click on the “All Forms” tab to see a view of all the forms on your site. In this example, we will use the Exam Form. Hover your cursor on the form cover and click on the “Dashboard” link.

Restrict WordPress Forms all form dashboard

You are now on the dashboard of the form. From here, you can configure, publish, and analyze forms. In short, you can use this space for complete WordPress form design. To move forward, scroll down to the “Configure” section. Then, click the “Access Control” icon to enable access control based on date, passphrase or user role.

Restrict WordPress Forms configure access control

Enable user role based access control for your form

In this situation, we restrict WordPress forms by user roles. So, scroll down to the “Enable user role based form access control” field. Check the checkbox to enable/restrict access to forms based on the current user role.

Restrict WordPress Forms access control

Only the users belonging to the selected roles from the underlying area can access the form. Select the user roles who can access the form. You can also select multiple user roles using the checkboxes below. Users exclusively with the selected “user roles” can access the form content. In this case, we select the “Administrator” role. This means that going forward no one other than the admins can access the form.

Restrict WordPress Forms enable roles

So, now let us try to access this form from the frontend.

You can see, we are getting an “access denied” message when we are trying to fill this form. This is because we made this form only accessible to the administrator, and I am logged in as an Author for this particular example.

User Role Based Account Creation

Now, we can configure a form to create a specific role with every user registration. This way, we can reduce the work of assigning roles to individual users.

First, select a form. Now, we will work with the Product form.

Restrict WordPress Forms all forms

Proceed to the dashboard of the form. Then go to Accounts.

Restrict WordPress Forms configure accounts

In the Accounts page of your form enable “Also create WP account“. Then in “WordPress user role” select any role of your choice. I selected Subscriber. Then Save the settings. Now whoever will fill this form will be automatically assigned the Subscriber role.

Restrict WordPress Forms product form

So, let’s check it out from the frontend. We will go to the User Area and find a user account who has submitted the form. We are going to see the role that the user has been assigned.

Restrict WordPress Forms frontend

So, we see the user Ron submitted the Product Form. Automatically, he got the role of a subscriber since we configured the form so.

List of Default WordPress User Roles

Administrator RoleUsers can access the dashboard, modify core files and themes using this role. An admin can also edit other user roles besides enjoying complete control over the content.

Editor Role – This role grants access to a part of the content. Editors cannot access themes, widgets, and plugins. The editor role can publish or edit any page or post.

Author Role – An author can only tweak elements of his/her own post. To sum up, they don’t have the permission to access the content of other users.

Contributor Role – After a contributor writes or modifies a post, he/she must seek permission from the admin to publish it. Contributors cannot access media files without the say of the admin or editor.

Subscriber Role – After WordPress new user registration, every user is offered a Subscriber role if not specifically set to any other role. Subscribers can only view your site and comment under your posts. However, they have their own limits. As a subscriber, you cannot alter settings or the content of the site.

Use the checkbox to select which “User Roles” can access your form. This way you can easily restrict WordPress forms by user roles in your forms.

 

With RegistrationMagic, you can create separate forms for separate purposes and users. And in just a few clicks, you are good to go. Hence, managing forms is no more a big deal with the use of RegistrationMagic. To know more about this plugin, visit our Facebook page.

About rmagic

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

Leave a Comment

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

shares