GuideBlog Posts

WooCommerce Age Verification: Popup, Checkout, and Cookie Setup

A popup, a checkout checkbox, or both—here is the fastest way to gate age-restricted WooCommerce products without wrecking checkout flow.

WooCommerce Age Verification: Popup, Checkout, and Cookie Setup
Photo: VINVIVU ® / Pexels
TL;DR

WooCommerce age verification works best as a dismissible full-site popup plus a checkout field that records the visitor’s confirmation. Set the verification cookie so returning visitors do not see the gate every session, and test the gate on mobile, incognito, and cached pages. A single plugin can handle the popup and a small WooCommerce checkout hook covers the legal checkbox.

Key takeaways

  • Put the popup at the first page load, not at checkout only, for alcohol and adult stores that age-gate the entire site.
  • Store the age confirmation in a cookie so logged-out visitors are not re-asked on every page.
  • Add a second verification step at checkout if you sell restricted products in an otherwise general store.
  • Test the popup with caching and incognito mode because a cached page can bypass a JavaScript-only gate.
  • Use a dedicated age verification plugin instead of a generic popup builder when you need cookie handling and restrict-by-product logic.

What You Need Before Adding WooCommerce Age Verification

You can get a basic age gate running in about 30–45 minutes. That includes installing the popup, adding the checkout field, and testing the cookie in an incognito window.

You need three things before you start: a working WooCommerce store, an age verification popup plugin, and a safe way to add PHP to your theme or site.

  • A working WooCommerce installation with your products and checkout already configured.
  • The Age Verification Popup plugin. Install it from Plugins → Add New Plugin → Upload Plugin.
  • A child theme or a code snippets plugin to add the checkout field. Avoid editing the parent theme's functions.php.
  • Access to your hosting file manager or FTP if you prefer to edit functions.php manually.
Open laptop displaying code next to a plush toy, set in a bright room with plants.
Photo: Daniil Komov / Pexels

Use a full-site popup if the entire store is age-restricted. Add a checkout checkbox if only some products are restricted, or if you want a less aggressive gate for returning customers. The best stores combine both: the popup blocks casual browsers, and the checkout field records the legal confirmation.

Where to put the age gate
Factor Full-site popup Checkout checkbox
Placement Any page before content loads WooCommerce checkout page only
Best when Entire catalog is age-restricted Only a few items are restricted
Visitor experience Heavy friction on first visit Light friction until purchase
Legal record Confirmation click only, not tied to order Stored with order as checkbox state
Cookie concerns Cookie can fail on shared devices or incognito No gate cookie needed; checkout field is per order
Conversion risk Higher bounce for casual traffic None until checkout, but restricted items may be added without check

Cookie-based popups have real gaps: shared devices, private windows, and cached pages can each resurface the gate or skip it when they shouldn’t. Checkout-only gates avoid that mess but let a restricted product sit in the cart until the final step.

Pair a dismissible full-site popup with a checkout checkbox. The popup sets the expectation, and the checkbox stores a confirmation with the order. If your catalog is a specific niche like wine or furniture, a matched theme can make the gate feel native; see Niche WooCommerce Themes for Wineries, Furniture, and Industry.

WorldPressIT All-Access

Every plugin and theme in this article, plus 11,000+ premium WordPress plugins and themes, in one membership.

From $14.99/month, or one lifetime payment. Cancel anytime.

See membership plans

Install and Configure the Age Verification Popup Plugin

You can have the popup live in about 15 minutes. The Age Verification Popup plugin is available on WorldPressIT as an original, virus-scanned file, so download that zip from your account before you start.

  1. Install the plugin zip In wp-admin, go to Plugins > Add New, click Upload Plugin, choose the zip you downloaded, then click Install Now.
  2. Activate the plugin Click Activate on the confirmation screen. If you already had a different popup plugin active, deactivate it first to avoid two overlays fighting over the same cookie.
  3. Open the age gate settings After activation, look for an Age Verification menu item or a settings link on the Plugins screen. If the plugin adds a Customizer panel, open that to preview the gate in real time.
  4. Set the gate text and display mode Enter the question and the two button labels — for example, “Are you 18 or older?” with “Yes” and “No.” Choose Full site so the gate appears on every page, or select specific pages if you only need it on age-restricted products.
  5. Save and test Click Save Changes (or Publish in the Customizer), then open a private browsing window to verify the popup appears on the homepage, a product page, and a category page. Mobile widths should scroll without pinning the buttons off-screen.

Set the verification cookie to 30 days so returning visitors skip the popup on the same browser. This takes under five minutes after the popup plugin is active.

  1. Open the Age Verification Popup settings In the WordPress admin, open the Age Verification Popup settings screen. Look for a cookie, expiration, or visitor memory section.
  2. Set the duration to 30 days If the plugin exposes a cookie expiry field, set it to 30 days. If it only offers a session cookie, test the dismiss behavior before assuming it persists.
  3. Clear cookies and verify re-gating Clear cookies for your domain or open a private window. Confirm the popup appears once, then reload and confirm it stays dismissed for that browser.
Age Verification Popup

Plugins

Age Verification Popup

The Age Verification Popup plugin on WorldPressIT handles the dismissible gate and stores the visitor confirmation. Use its cookie settings if available, then test on a real mobile browser.

v1.5.1 · Updated November 17, 2026Get it for $4.99

Add an Age Checkbox to WooCommerce Checkout

You need roughly 20 minutes to add and test a required age checkbox at checkout. This section assumes you already run WooCommerce and can edit functions.php through a child theme or a code snippets plugin.

  1. Add the checkout field In your child theme functions.php or code snippet, hook woocommerce_checkout_fields and add a required checkbox to the billing field group. Use a clear label like 'I confirm I am at least 18 years old'.
  2. Validate server-side Hook woocommerce_checkout_process. If the box is unchecked, call wc_add_notice() with an error and return. Never rely on browser-side checks alone.
  3. Store the answer in order meta Hook woocommerce_checkout_update_order_meta. Save the checkbox value as _age_verified using update_post_meta().
  4. Test thoroughly Place a test order without checking the box, then again with it checked. Open the order in wp-admin to confirm the meta is recorded.
add_filter( 'woocommerce_checkout_fields', function( $fields ) {
    $fields['billing']['age_verification'] = array(
        'type'     => 'checkbox',
        'label'    => 'I confirm I am at least 18 years old',
        'required' => true,
        'class'    => array( 'form-row-wide' ),
    );
    return $fields;
});

add_action( 'woocommerce_checkout_process', function() {
    if ( empty( $_POST['age_verification'] ) ) {
        wc_add_notice( __( 'Please confirm your age.' ), 'error' );
    }
});

add_action( 'woocommerce_checkout_update_order_meta', function( $order_id ) {
    if ( ! empty( $_POST['age_verification'] ) ) {
        update_post_meta( $order_id, '_age_verified', 'yes' );
    }
});

If you already customise checkout fields for B2B roles, the same woocommerce_checkout_fields filter controls visibility and requirements. Read the Role-Based Pricing in WooCommerce guide for more context on conditional checkout logic.

Common Mistakes and Troubleshooting

Most failed age gates come down to four issues: cached popups, checkout validation that never runs, cookies set before confirmation, and JavaScript conflicts from page builders. Fix each one as it appears, then document the repeat offenders so you stop billing the same debugging hour twice. A set of WordPress admin plugins that reduce agency support tickets can also cut the time you spend on client hand-holding.

The Age Verification Popup plugin costs $4.99. WooCommerce.com sells the same original file at a higher vendor price. If you need one age gate on one store, buy the standalone plugin and skip the membership.

For freelancers and agencies that install age gates across client stores, the All-Access membership is the cheaper route. It costs $14.99/month for ongoing updates and downloads.

My default for a single WooCommerce store is the dedicated Age Verification Popup plugin because the cookie settings and full-site gate are already built for this task. Do not pay for a general popup builder unless you also need lead forms, announcements, or product upsells. Bill the plugin as a line item in client quotes instead of building the gate from scratch.

Firebox Pro – WordPress Popup Builder Plugin

Plugins

Firebox Pro – WordPress Popup Builder Plugin

Firebox Pro is the general popup alternative if you need to combine age gating with lead capture, discount popups, or exit-intent campaigns. It does not include the age verification cookie logic, so you will recreate the cookie and checkout hook from earlier sections.

v3.1.17 · Updated November 30, 2026Get it for $4.99

Frequently asked questions

Is WooCommerce age verification required for selling alcohol online?

WooCommerce itself does not enforce age verification. You are responsible for complying with the alcohol laws in each market you sell to. A dismissible popup plus a required checkout checkbox is the usual way to document that the buyer confirmed their age.

Can I add age verification to specific WooCommerce products only?

Yes. Set the popup to display only on selected product, category, or page URLs if the plugin supports page-level targeting. Then use the checkout field with a WooCommerce conditional hook so the age checkbox appears only when a restricted product is in the cart. This keeps the gate off general catalog pages.

Will an age verification popup hurt my store's SEO?

Googlebot does not click age confirmation buttons, so a full-page popup that blocks content can prevent search engines from rendering the page. If SEO is a concern, show the content in the HTML behind the overlay rather than removing it, and make sure the popup does not return a 5xx or redirect for crawlers. Most age gate plugins keep the content in the DOM and style the overlay on top.

How do I stop the age popup from showing on every page?

Set the verification cookie after the visitor confirms their age and choose a duration like 30 days. The cookie tells the plugin to skip the popup on later page loads in the same browser. Clearing cookies or using a private window will bring the gate back, which is the expected behavior.

Do WooCommerce age verification plugins work with caching?

Yes, but cached HTML can cause issues. Some caching layers store the popup state and show it again even after a visitor has verified. Exclude the age verification cookie from the cache key or use a cache-friendly setup, then test in an incognito window after activating the plugin.

What is the best free age verification method for WooCommerce?

A custom woocommerce_checkout_fields checkbox with server-side validation is the most reliable free option. It works without a popup plugin, but it only gates checkout, not product browsing. Pair it with a simple JavaScript overlay if you want a free full-site gate, but test carefully on cached pages.

Share X LinkedIn Facebook
Giora Denzel
Written by

Giora Denzel

E-commerce builder. Giora runs WooCommerce, membership and course projects for small brands, and writes about payments, subscriptions, LMS, bookings and the tooling behind online stores.

Products in this article

Browse all