Learn how to add age restrictions to WordPress forms with step-by-step instructions easily. Ensure only users of a certain age can access your content.
Read time: 5 minutes
Struggling to add age restrictions to your WordPress forms?
Whether for legal reasons or to keep things safe, it's frustrating if you're unsure where to start. Luckily, adding age limits to your forms doesn't have to be complicated.
Get the Age Restriction Plugin for WordPress!
This post will show you how to easily set up WordPress age restrictions on forms, saving you time and headaches.
Let's get started.
Why add age restrictions to forms?
Adding age verification to WordPress forms is a smart move for several reasons.
First, it helps meet legal requirements. For businesses dealing with age-sensitive products or services (like alcohol or gambling), you must ensure users are of legal age before they can view content or make purchases.
Age limits also improve content safety by restricting access to sensitive or inappropriate information. Last, it helps create a more tailored experience. For example, the website can offer products or services relevant to a user's age.
And that increases conversion rates.
How to add age restrictions to WordPress forms
Now that you know the benefits of creating age-restricted forms, let's learn how to add 18+ warnings to a WordPress site.
ℹ️ For this tutorial, you'll need to already have the Formidable Forms plugin on your WordPress website. Formidable Forms is the best WordPress form plugin, and its datepicker helps set up age verification. So, follow these steps to install and activate Formidable Forms.
You'll also need the Formidable Forms premium plugin to unlock our advanced Datepicker feature.
Don't have one of these plans yet? Click the button below to pick up a license.
Then it's three easy steps to add age verification:
Step 1: Install the Formidable Forms Datepicker Options add-on
To start using the Datepicker Options add-on, open the WordPress dashboard.
Next, go to Formidable → Add-Ons and look for Datepicker Options:
Finally, click on the Activate button. Once that's active, it's time to create the form and set up custom age verification.
Step 2: Create a form with a date field
Next, you'll need to add a new form.
To do this, navigate to Formidable → Forms → Add New:
Then, there are three options:
- Build a form from scratch
- Use a pre-built WordPress form template
- Use Formidable's AI form builder
After you choose an option, the plugin opens the drag and drop form builder. Here, you can add any form fields you need on your form.
But to add an age restriction, find the Date field. This is under Advanced Fields:
Drag and drop this field anywhere on your form. Continue customizing the form to fit your needs then we'll set a maximum date in the next step.
Step 3: Set a maximum date
Next, click on the Date field to display the field customization options.
To gain full control over the form field, give it a name so users know what information to enter. We'd recommend setting the field label as "Birthday" or "Date of Birth."
Next, check the box next to Required to ensure users fill out this field. This will prevent anyone who leaves this field blank from submitting an entry.
The form will automatically set up a Year Range by default. In the first value, you'll need to enter the start year. This depends on what you want to set as the oldest birth year.
For example, write "-90" to include dates for the past 90 years. This includes everyone above 18 (and then some). As for the End value, enter "-18". Doing this, you'll include dates up until 18 years ago.
Here's how the new age range should look:
Then, scroll down to the Advanced section. Select the option to Set specific minimum and maximum dates.
For the Maximum field, choose Current Date. Then, in the text box that appears next to it, enter "-18 years".
This sets the minimum age requirement for users over 18 years old:
After this, click Update. Then, you can preview the form and test the Date of Birth field. The form will display an error message if you enter a date within the last 17 years.
You can change the age verify error message to whatever you like.
Once you've finished customizing your form and tested its settings, you can embed it anywhere on your website. It's ready to go. Once users have verified their age, they can submit the form.
Ready to add age restrictions to your forms?
Adding age restrictions to your WordPress forms is a simple but important step for legal compliance and protecting content.
With the right tools, it’s easy to set up and ensures you’re offering your users a safe and tailored experience. Now that you know how to implement it, you can keep your forms secure and hassle-free.
So, grab Formidable Forms Pro today using the button below and get started!
Also, join our community on Facebook, Twitter, and YouTube for more WordPress tips and tricks!
Leave a Reply