Do you want to restrict WordPress forms to only logged-in users on your site?
If there are certain parts of your website that you only wish to be accessible for your subscribers or registered users, then it may be a good idea to restrict some forms to logged-in users only.
Thankfully, it’s very easy to enforce access restrictions on your WordPress forms.
In this article, we’ll show you how to restrict your WordPress forms to make sure your form entries only come from users who are logged in.
Why Restrict Access to Your WordPress Forms?
There are many reasons why you might want to restrict some of your WordPress forms to logged-in users on your site.
Take a look at some examples:
- You may be hosting a members-only event that is off-limits to non-registered users.
- You may have a special promo code or other surprises that you only want to reveal to your logged-in subscribers.
- You’re running a giveaway campaign that is only open to those that have registered on your website.
- You want logged-in users to access your customer support ticket form to submit queries and complaints.
These are only a few common scenarios where you might want to create restricted forms. But it’s entirely up to your marketing strategy how you want to target different features and services of your site to different levels of users.
How to Restrict WordPress Forms to Logged-in Users
The best way to restrict WordPress form access is to use WPForms, a user-friendly plugin that allows you to set access restrictions in just a few minutes.
In This Article
Let’s begin the step-by-step tutorial.
Step 1: Install WPForms
WPForms was designed to make it super simple for beginners to build awesome forms fast. Besides, it has tons of addons that enhance your form functionalities, like controlling user access restrictions.
So we’re going to use WPForms to first create a form and then enforce user access restrictions to logged-in visitors only.
But first, we must install the WPForms plugin to your WordPress site. Head over to WPForms and purchase a plan. Please bear in mind that the Form Locker addon (which we need to set user permissions) is only available in Pro and above plans.
Note: Actual pricing might not be accurately reflected in the image above. Please visit the pricing page to see current pricing details.
Once you’ve purchased the plan, you can proceed to install WPForms on your site. If you don’t know how, see this tutorial on installing a WordPress plugin,
Step 2: Install and Activate Form Locker Addon
After installing WPForms on your WordPress site, we’ll now install the Form Locker addon. This feature will allow you to change user permissions for any form you create with WPForms.
To install Form Locker, open your WordPress dashboard and go to WPForms » Addons on the sidebar menu.
In the next window, type in “Form Locker” in the search field located on the top-right. Click on the Install Addon button when Form Locker Addon shows up in search results.
This will instantly install the Form Locker Addon for your WPForms plugin, and the Status will now read “Active“.
You can now enforce access restrictions on your forms.
Step 3: Create a New Form with WPForms
Now, we’re going to create a new form and add access restrictions to it. You can use any one of the 600+ pre-built WPForm templates to create a form that best suits your goals. Plus, all form templates support access restrictions.
To start creating a form, hover your cursor over WPForms in your WordPress dashboard’s sidebar and then click on Add New.
Now, pick a template of your choice by clicking on the Use Template button that appears when you hover your cursor over a template. For this tutorial, we’re using the Fitness Interest Form, but you can use any as per your preference.
This will open the Form Builder screen where you can edit the fields or add new ones to customize your template.
The right half of the screen displays the live preview of your actual form. You can add new fields by dragging and dropping these from the left side to the right-hand panel.
Also, you can access options like Move, Edit, Delete, and more by moving your cursor over each field in the right-hand panel.
Once you’ve customized your form, you can change access restrictions so only logged-in users can see your new form.
Step 4: Change Access Restrictions with Form Locker Addon
Now, click on Settings on the left-hand bar of your form builder. Then, click on Form Locker.
Here, you can choose different ways of restricting form access to your users. If you want to restrict form access to only logged-in users, click on the toggle button next to “Logged in users only“.
You can also add a message that will display when those users who aren’t logged in try to access your restricted form.
The message is also a good place to add quick links that users can click to register or log in to your site.
Next, simply click on the Save button on the top-right to finish creating your WPForms with access restrictions.
You can view your WPForms entries right on your WordPress dashboard. Or you can also see submissions in WordPress database since WPForms performs WordPress data collection automatically for you.