Guide
How to add an age verification popup on WooCommerce
27 November 2026
WooCommerce is WordPress with a shop. An age check for the whole shop is the same snippet as any other site, pasted once into the footer so every page gets it. It is a self-declaration. Visitors say they are old enough, or enter a date of birth. Nothing checks an identity document, and this page is not legal advice.
Paste it in the footer
Build the snippet on the Age Gate Builder. The builder's page gives these steps for WooCommerce:
- Install a header and footer code plugin (for example WPCode), or use your theme's own custom code box if it has one.
- Paste the snippet into the site-wide footer box.
- Save. If you use a caching plugin, clear its cache.
The block belongs just before </body>, which is what a footer box is for. A cache can keep serving the old HTML, so the third step is part of the test, not a tidy-up.
What a pass stores
After a pass the snippet writes one cookie, agb_pass=1, in the visitor's browser for your site. The minimum age, the button labels and the colours are already inside the snippet. They are not looked up from this site later. A date of birth is used in the browser to work out the age and is not put in the cookie.
Remembered days run from 0 to 365 and start at 30. The builder's page says that 0 asks again each time the browser is reopened. Above 0, the cookie's lifetime is that many days. To see the popup again while you are testing, delete agb_pass or open a private window.
Suggestion lists for "woocommerce age verification popup" include "plugin", "not working" and "not showing", and also the words WordPress and Squarespace. A plugin is one way to hold the footer box. The snippet itself is not a WooCommerce plugin: it does not add a settings screen, and it does not call this site when the popup runs. If the popup does not show, the usual checks are that the footer box is on, the cache was cleared, and an old agb_pass cookie is not still set.
The free snippet includes a small "Age gate by Age Gate Builder" link. Colours, the logo address and the "no" redirect are set on the builder before you copy. The logo has to be an https address or a path on your own site.
Shopify's steps are in How to add an age verification popup on Shopify. The block itself is in What an HTML age verification popup contains.
What the builder records
Opening the builder sends a page view to this site. Pressing Copy the snippet sends a product use, because that button is marked for it. Both go out as a beacon (POST /api/t) with the page address, the site that linked here, a campaign tag if the link had one, and a width class: under 640 pixels, under 1024, or wider. The beacon does not include the words you type. Scrolling records depth at 25, 50, 75 and 100 percent. A click records where it landed, as percentages, plus the element's tag, id or class, and not the text. If the browser sends Do Not Track or Global Privacy Control, the script stops before sending, and the server drops a beacon that still arrives with that signal. The privacy page is the full account.