How to Add Age Verification to Websites: Full Guide
Website age verification helps you comply with age restrictions and regulations regarding sensitive content or products in most countries. Whether you're running an online store for alcohol, tobacco, or adult-oriented material or simply want to protect minors from accessing inappropriate content, implementing age verification on your website is crucial. It can save your online business and reputation.
In this article, we will explain the different types of age verification pop-ups and share information about how to add age verification pop-ups to websites, with and without coding knowledge. Let’s get started.
What is age verification for a website?
An age verification popup is a full-screen widget for site that blocks access to content upon entry. It requires visitors to verify they are legally old enough to gain access.
The main reason for using website age verification pop-ups is to prevent children from accessing content or purchasing products meant for adults. You must comply with laws and regulations introduced by legal institutions within your region. By requiring users to confirm their age before accessing age-restricted content, you create a safer and more responsible online environment.
How to add age verification to sites
If you're wondering how to add age verification for website compliance, there are two primary ways of implementing it. One requires a grasp of coding, while the other uses Claspo’s templates and creates a pop-up in 5 minutes with no design or coding skills.
Way 1. Code-based method
This approach requires you to paste your code directly into your website. It’s not that big of a deal when you know programming and understand the basics. However, if you lack these skills, this will be a massive pain in your backside, especially if you plan on customizing the widget to your branding, unique needs, etc. Expect to either spend a lot of time getting everything to work right or hire a developer to help you implement this relatively simple feature.
Let’s look at sample HTML, CSS, and JavaScript codes in case you decide to go the manual route.
1. Free age verification HTML code
Free age verification HTML code examples are readily available in online communities for testers and discussion forums for programmers. Here is a small sample we came up with:
<div id="age-verify">
<div class="window">
2. Free age verification for CSS part
The free CSS age verification sample code will look something like this:
$font-stack: 'Source Sans Pro', sans-serif;
$transition: 500ms;
3. Free age verification for JavaScript
Finally, the JavaScript age verification popup requires a sample code like this:
overAge = function () {
$('#age-verify').addClass('hidden');
Way 2. Adding age verification to a website with Claspo
If you are not familiar with coding, have no intention of involving developers in creating a pop-up, or don’t feel like doing the extra work, you can add website age verification with Claspo for free. It’s a super-simple process that you can complete in a few minutes to comply with all the laws and guidelines.
When setting up a free age verification for your website with Claspo, you can choose a ready-made template from the library or create a new widget from scratch.
Step 1. Log in and set up the filters
To get started, auto-login to the site using your email. Then click on the New Widget button. We will now turn to the choice of templates.
Use the filters to make the right choice. The very first filter is the use case. For our purpose, we need the “Verify Age” use case. When you select it, the system automatically selects free age verification widget templates that meet your requirements. These popup templates are pre-configured to comply with age-restricted content regulations, helping you quickly set up a compliant gate without designing from scratch.
You don’t need to bother with the rest of the filters since age verification widgets have the same layout (content-blocker) and are not associated with a specific holiday or occasion.
Step 2. Edit the template
Select the template you like and proceed to the builder. Here, the only limit is your imagination. You can customize your template to suit your needs and branding.
After that, make any necessary adjustments, preview the widget on desktop and mobile platforms, and proceed to the next steps.
Step 3. Choose the widget display rules
For your convenience, we’ve set up display rules that fit your goal. In particular, your age verification widget immediately appears when users visit your website and disappears only when they verify their age. You can always customize these settings and also choose display frequency:
- Do not limit. The widget appears every time the user visits your website or its specific pages.
- Once per session. The widget reappears with each new session (a session ends after 30 minutes of user inactivity on the website).
- Only once. The widget appears once and doesn't reappear as long as the user's cookies are stored on the website.
- One time per {period}. The widget updates the user's age data at the frequency you select.
For example, you can use geotargeting to only display your pop-up to people in specific locations. Different countries and administrative regions have different required ages for adult content, so you can easily set it up to show different ages for each one.
Additionally, you can set up different language versions that will switch depending on your users’ browser language settings or the language they choose on your website. When you add a new language version to your widget, your original text is automatically translated into the selected language using ChatGPT-4o, and you can edit it after that. It's super easy and convenient!
Step 4. Set up integrations
Claspo allows you to easily integrate with many popular platforms, such as CRMs, CDPs, ESPs, and more. In this case, you can ignore this step, as you may not need any martech tools to transfer users’ data. You can also integrate Claspo with Google Analytics to track how many users interact with your widget.
Step 5. Add the widget to your website
After you've finished editing and customizing your widget, we'll provide you with a ready-made script to copy and paste into your website. You can easily add our widgets to any CMS using Google Tag Manager — this also works great if you prefer to create a WordPress popup without plugin installation, keeping your site lightweight and plugin-free. If you're a WordPress user, simply install the Claspo’s age verification plugin for WordPress to make the widget installation process even easier and add a WordPress popup form to your site. Also, we have a Shopify app. If you have any issues, just contact our customer success manager, and we will embed a widget for you for free.
How do you create an age verification pop-up from scratch?
Claspo allows you to create free age verification widgets for websites from scratch. It’s also quick and easy — a great solution for anyone searching for age verification online, free of charge. Here’s how this process works.
Step 1. Get started
In the same way as before, you log in, but now you choose from ready-made proposed solutions.
Step 2. Select the base layout
With Claspo, you don’t create from a completely blank slate. Instead, you choose from several generic base layouts that allow you to implement any ideas.
Step 3. Set up your layout
Choose the containers, resize, insert images, and write your text. Don’t forget to check the “Insufficient age” state as well. You can create a widget like this in less than five minutes. Want to know how we know? Because it only took us three!
Step 4. Finalize
After you’ve designed your widget, proceed to the next steps as you would with a template. Choose the website age verification triggering rules and integrations, check your results, and insert the script code.
Ready-to-use age verification pop-up templates from Claspo
With Claspo’s many ready-to-use templates, it’s easy to find the perfect fit for age verification websites that match your goals and style.
If you sell alcohol, “Friday Night” might be your choice. A moody bar setting with dim lights will fit any liquor store.
Are you doing business with games of luck or skill? “Game Awaits” is the perfect template for a casino or other gambling business.
Is what you’re offering spicy and taboo? Try “Pleasant Mood” for businesses offering adult goods or content.
More than age gates: what else you can create with Claspo
Sure, age verification is a major step — especially when you need to prevent minors from accessing age-restricted products or content. But if you're only using Claspo for age gates, you're just scratching the surface.
Claspo is actually a full-blown popup maker and online age verification system that gives you a ton of options to engage users, not just require users to verify their age. And the best part? It’s easy to use, requires no coding knowledge, and helps you protect your business while leveling up your user experience.
So, what else can you do with it besides setting a widget on your website to comply with legal requirements? Here’s what marketers love using Claspo for:
- Lead generation popups that collect emails, phone numbers, or other personal information — perfect for building your list while users explore your website’s offers. For example, Absolut Vodka invites users who have passed age verification to subscribe to its weekly newsletter. As an incentive, subscribers receive cocktail recipes and drink inspiration straight to their inbox.
- Gamified widgets (yep, like spin-the-wheel, pick a gift or scratch cards) — especially great for e-commerce, or any brand that wants to make promotions fun.
- Cross-sell & upsell banners that pop up based on what users are browsing or adding to their cart. Great for promoting products online to users of a certain age.
- Exit-intent popups that show up just in time to stop someone from leaving — maybe offer a discount, a freebie, or something else.
- Multi-step forms — useful when you need more than just an email, like getting a quote, feedback, or even creating quizzes for specific age groups.
- Announcement bars and timers — highlight flash sales that're only available for a limited time.
For example, on the PAX website, you’ll find not only an age verification gate, but also an announcement bar at the top highlighting free shipping terms, along with a floating box featuring a multi-step subscription form. In the first step, users are invited to subscribe to the newsletter in exchange for a discount. Once they agree, the next step appears with a field to enter their email address.
Each widget is fully customizable and adapts to mobile automatically — whether you're showing an age gate or a mobile pop-up for discounts, announcements, or lead capture, everything looks great and works flawlessly..
Claspo is a secure and reliable tool for businesses that work with certain types of content, especially if it’s inappropriate or harmful for minors. Whether you sell alcohol, gamble-related products, wellness goods, or digital content, Claspo helps you ensure that the content only reaches the right audience — and that your site follows the best practices in robust age verification measures.
You can start building widgets on your website for free, and set up age verification software or conversion-boosting popups in minutes.
When does a website need online age verification?
Age verification is necessary for websites that offer age-sensitive products like alcohol and cigarettes, adult-only content, gambling, and others. You usually need to introduce age verification pop-ups on your website when:
- You distribute content or goods not meant for minors.
- The law of your country requires age confirmation.
For example, the Food and Drug Administration (FDA) prohibits the sale of tobacco products (including hookah and e-cigarettes) to consumers under 21 years of age in the US. Retailers operating in this niche can find detailed information on the FDA's official website on how to comply with these rules.
Moreover, a simple age verification pop-up may need to be revised to comply with industry regulations. Most states in the US require that a consumer present a valid government-issued ID to prove their age when they buy alcoholic drinks.
The world of online entertainment is no different. In the US, the Children's Online Privacy Protection Act Rule (COPPA) limits the consumption of online content by users under the age of 13. Similar restrictions are imposed in the EU General Data Protection Regulation (GDPR). Both regulations limit the collection of personally identifiable information from underaged people without their parent's consent.
Types of website age verification
There are several user’s age verification pop-ups, ranging from a simple age verification inquiry to more advanced techniques like AI-powered face recognition.
A regular age gate pop-up usually looks like this.
Depending on the time and place, a website age verification may be displayed:
- on every page;
- on specific product pages;
- at the checkout.
Many websites ask for users' dates of birth instead of a simple “yes” or “no” question. If you acquire contact details from the user, you can add this personal data for future marketing and analytical purposes.
Depending on the industry requirements and local regulations, the user’s date of birth might suffice. Still, you can also ask for personal details like the address or require uploading an ID photo. You can also bake in age verification with other functions. The example below gets your age and immediately asks your location to improve your shopping experience.
We’ve also seen other, stricter verification methods that go beyond the scope of simple pop-ups. For example, some websites might ask you to scan or upload a photo of your ID, as Meta does.
And you can’t go anywhere without AI in this day and age. So, naturally, there are already tools with AI-powered age verification systems Trust Stamp, Veriff, Facia, and others.
Regardless of the age verification process you opt for, ensure that your Privacy Policy clearly states the purpose of such data collection.
How to use age verification to avoid problems
Age verification sites are a must if you operate in an age-sensitive niche and aim to ensure that your website complies with laws and regulations issued by legal institutions. Violating these rules can entail fines or even imprisonment.
Age verification pop-ups are extensively used to restrict underage users from accessing your website when browsing. Such pop-ups usually convey the same idea: warn customers about the age restrictions introduced on your website. Depending on your preferences and the legal age requirements of local authorities, you may supply your age verification pop-up with additional information for parents or provide a link to your Terms of Use.
Start with our free lifetime plan and immediately create your first age verification popup with no design or coding skills!
FAQ
Is asking for a birthdate enough to keep minors off my website?
Not always. While asking for a birthdate is a common first step, it's not foolproof. Some users might enter a fake date just to access age-restricted content. That’s why age verification is an important part of protecting your business — especially if you deal with products like online alcohol, tobacco, or adult goods.
If you’re in a highly regulated industry, you might need a more robust solution — for example, one that requires users to check a box per accepted verification standards, or even upload an ID in some regions. The key is to strike a balance between ease of access and proper protection.
How can I ensure my age verification process complies with local regulations?
Start by knowing your audience and where they’re browsing from — different countries (and even states!) have their own rules. For example, in the U.S., users must be 21+ to buy tobacco or alcohol online, while in the EU, data privacy laws also come into play when collecting personal info.
A great way to ensure compliance with legal regulations is to use an age verification popup tool that supports geotargeting. Claspo lets you display the widget based on location.
What should I look for in an age verification solution?
Look for something that checks all these boxes:
- Easy to use and quick to set up (bonus points if it needs no code).
- Flexible — lets you customize for different regions, languages, or specific age requirements.
- Works on all devices seamlessly.
- Doesn’t frustrate visitors but still helps you protect your customers and brand.
- Offers integrations or tracking to see how users interact with it.
In short, a solid tool should offer proper age verification while also enhancing the user experience — not hurting it.
What’s the difference between basic and advanced age verification systems?
Think of it like this: a basic system asks “Are you 18?” with Yes/No buttons or a simple birthdate field. It’s fast and lightweight — great for low-risk situations. An advanced system might go further: using cookies to remember past answers, geolocation to adjust the specific age, or even facial recognition or ID scanning for high-risk industries. These robust age verification tools are especially useful when legal compliance is non-negotiable, or when you need to restrict access to age-restricted content more tightly.
How do I choose the right age verification popup for my business?
Start with your industry. If you’re selling age-restricted products like online alcohol, CBD, or adult items, you’ll want something a bit more than just a checkbox.
Then think about user experience: will your visitors find it annoying or helpful? The right tool should let you display the widget cleanly, match your branding, and adjust settings for different regions and age thresholds.
Claspo, for example, makes it easy to choose from stylish templates or build from scratch. It helps you access age-restricted audience segments responsibly, while keeping things smooth and seamlessly integrated into your site.
Hey, thanks for the super informative piece on age verification pop-ups! Just dove into the online retail world myself and man all the legal stuff especially for my adult-beverage line kinda overwhelming. Your article totally cleared up, keep rolling out these awesome guides!
Thank you, Dana!
Working as a digital marketer with a bunch of e-commerce sites, staying on top of the legal stuff for online selling is super important. I really dug the guide for setting up these pop-ups those coding examples are a fantastic addition for those of us who like to get our hands dirty. Awesome job! 👍🏻
The article has info for my business about website age verification. Thank you for the detailed guide 🥰 but, one point isn't understandable, it is a little bit missarable for me. How can age verification pop-ups customized to suit different websites and industries?
Elizabeth, you are welcome! We are glad you found the guide helpful. Customizing age verification pop-ups to suit different websites and industries is essential to ensure a seamless user experience. Start by designing the pop-up to match your website's overall look and feel. Use your brand colors, fonts, and logo to make it feel like a natural part of your site.
Not using age verification pop-ups could lead to underage access, potential harm, legal repercussions, regulatory non-compliance, reputational damage, increased risk of addiction, negative societal impact, and compromised user safety. One well-known situation in the USA related to the lack of age verification is the "Cambridge Analytica scandal" involving Facebook. In 2018, it was revealed that the personal data of millions of Facebook users had been harvested without their consent. This incident raised concerns about privacy, data protection, and the potential misuse of personal information. It highlighted the need for robust age verification measures to protect users, particularly minors, from unauthorized access to sensitive data and potential harm.
It's a game-changer for any website that needs age verification. This tool is ridiculously easy to use, even for us non-tech-savvy folks. It gives you a step-by-step guide on how to add a cool age verification pop-up to your website with just a few clicks. You know, those pop-ups that ask visitors to confirm their age before accessing certain content.