Blog

Restrict WordPress Registrations by Age and other Parameters

How to restrict WordPress registrations by age and other parameters?

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.

Related Articles
  1. How to Restrict User Access by Date in WordPress
  2. How to Restrict WordPress User Access by Passphrase Code
  3. How to Restrict WordPress Forms by User Roles

Access settings are accessible from Form Configuration Panel and are found inside Access Control area.

Restrict WordPress Registrations by Age -1

Clicking it will open new set of options. There are multiple access control restriction settings here. We’ll discuss them one at a time:

Restrict WordPress Registrations by Age -2

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.

Restrict WordPress Registrations by Age - 3

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:

Restrict WordPress Registrations by Age - 4

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.

Restrict WordPress Registrations by Age - 5

And to the users:

Restrict WordPress Registrations by Age - 6

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.

Restrict WordPress Registrations by Age - 7

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:

Restrict WordPress Registrations by Age - 8

That wraps up our demonstration to setup access control and restrict WordPress registrations by Age. Until next time!

Leave a Comment

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