Introduction: WordPress Registrations By Age and Other Parameters
Welcome to our tutorial on how to restrict WordPress registrations by age (or other parameters). Every membership site has its own set of parameters. Among the most common of them, is age based restrictions. It means asking users to first enter their date of birth or declare that they are of certain age before filling up the form. See fair share of them, don’t we? Now let’s see how to restrict WordPress registrations by age on our own WordPress site (and perhaps learn a few new tricks along the way!). This is all the more important, when it involves user registrations. RegistrationMagic has built in support for form access control, allowing greater control over who fills out the registration forms.
Table of Content
Access settings are accessible from Form Configuration Panel and are found inside Access Control area.
Clicking it will open new set of options. There are multiple access control restriction settings here. We’ll discuss them one at a time:
1. ENABLE DATE BASED FORM ACCESS CONTROL
Turning this one on will ask users to enter a date before the form shows up (given the date matches the criteria we set up in next steps). Remember, this date is not necessarily a birth date, and we can customize it to fit any date based criteria. Although it will most commonly be used that way.
First option is QUESTION FOR ASKING DATE. It’s the question which our visitor will see above the date text box. Let’s type in Please enter your date of birth to proceed. Next is LIMIT TYPE. It has two options – to set the input date within a range of years relative to present day. For example, if we only wish to allow registrations for users between 18 to 60 years, we will have to set the Lower Limit as 18 and Upper Limit as 60.
Alternatively, if we wish to allow users who fill in a date between two specific dates, we should choose Absolute Dates option. This will turn Upper Limit and Lower Limit boxes into date input box where we can set date range.
Here’s how the form will look to the user:
A note – If you do not need either upper or lower limit for a form, just leave it blank.
2. ENABLE PASSPHRASE BASED FORM ACCESS CONTROL:
This is as straightforward as it sounds. We can create a custom passphrase, and only those who have it shall be able to fill the form after entering it. Something like secret entrance code. The passphrase can be distributed using a newsletter or within autoresponder of another of our forms, or by multitudes of other methods.
QUESTION FOR ASKING PASSPHRASE serves same purpose as the question in date range setting. PASSPHRASE is actually the phrase we want to use. Without being too fancy, we’ll just use a random string of characters in our demo.
And to the users:
3. ENABLE USER ROLE BASED FORM ACCESS CONTROL:
This restriction is fundamentally different from the top two. It requires visitor to be logged in already before being able to fill up the form. In that sense, it cannot be used for first time registrations. But comes handy, if we use multiple roles on the site and wish specific forms to be accessible to certain user roles. A user whose role does not matches will see a denial message that can be customized below.
So what happens if we turn on more than one restrictions at a time? Well, they’ll all be shown on same page and verified before filling up the form. Here’s an example:
That wraps up our demonstration to setup access control and restrict WordPress registrations by Age. Until next time!
- 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