Theme guide

Free age verification pop-up for Shopify, without an app

What you’ll need

  • The theme editor (to add a Custom Liquid block; no code editing)

    How to get this: The theme editor
    1. Online Store › Themes › Edit theme (on a copy of your theme if you want to test first).
    2. Add section or Add block › Custom Liquid, paste the code, then Save.

    Step-by-step guide (opens in a new tab)

  • Your settings for the feature (for example your free shipping amount or countdown end date)

Make my age verification pop-up

Add it in three minutes

  1. Open the Liquid Snippet Studio and choose Age verification pop-up.
  2. Pick yes/no buttons or date of birth, the minimum age, and where it shows: every page, one collection, or products with a tag.
  3. In Online Store › Themes › Customize, click Add section › Custom Liquid in the Header area.
  4. Paste the code and Save. Open your store in a private window to see the pop-up.

Why the theme editor isn’t blocked

Many age gates also cover the theme editor, so you can’t click anything while editing. Ours checks request.design_mode, Shopify’s flag for the editor, and shows a small yellow note there instead of the pop-up.

What it does and doesn’t do

  • It asks, it doesn’t prove. A pop-up can’t check ID. For regulated products (alcohol shipping, tobacco, vape) you may need an ID check at checkout from an age verification service, and your local rules decide that.
  • It remembers a yes on the visitor’s device for the number of days you set (0 asks on each new visit). No cookie banner is needed for it: it stores a date, not a tracking ID.
  • Search engines can still read your pages: the products are in the page behind the pop-up.
  • It uses a native dialog, so keyboard users can reach the buttons and the page behind can’t be clicked.

How it behaves

  • Works in Dawn 16.2.0 and Horizon 4.5.0.
  • The pop-up shows on the first page a visitor opens. The store behind is dimmed and blurred, links behind it can’t be clicked, and Escape doesn’t close it.
  • “No” shows the under-age message with a Go back button; reloading asks again. “Yes, enter” closes it, and it doesn’t come back on later pages.
  • In the theme editor the pop-up is replaced by a yellow note, so you can keep editing.

Removing an old age verification app

Uninstalling an app often leaves its code in theme.liquid, so the old pop-up keeps showing. Our Leftover App Code Finder lists those lines so you can remove them before adding this one.

Questions

Can I verify age at checkout?

Not with theme code: checkout isn’t part of your theme. Shopify Plus stores can add a checkout extension, and other plans need an age verification app that checks at checkout.

Does it work with Shopify Markets and translations?

Yes. It’s plain HTML on every page. Type the text in your main language; for other languages, make one block per language or translate the text in the code.

More guides