Setting up Age Verification
TitanCart’s built-in Age Verification lets you gate age-sensitive products — alcohol, vaping, knives, adult content, and the like — behind an age check. It works at three levels that you can mix and match: a single product, a whole category, or your entire storefront. Unlike some bolt-on plugins, the check is enforced on the server: a restricted item can’t be added to the cart or checked out until the visitor has verified, so deleting the pop-up or hitting the cart directly won’t get around it. It’s a core feature — no separate purchase or external account is required.
1. Enable the Age Verification extension
- In wp-admin, go to TitanCart → Extensions → Installed Extensions.
- Find Age Verification in the Built-in Extensions card and set its Status toggle to Active.
- Click the gear icon on that row to open the Age Verification settings page.
Note: Age Verification needs no API keys or external service — turning it on and configuring the settings below is all that’s required. (This is different from reCAPTCHA, which needs keys from Google.)
2. Configure the global settings
The settings page has two sections: General and Site-wide Gate. Start with General — these defaults apply everywhere unless a product or category overrides them.
- Default minimum age — defaults to
18. Used for any product or category you mark as age-restricted without giving it an explicit age. - Verification method — how the visitor proves their age (default: Enter date of birth). See step 5 for the three options.
- Warning message — shown when a restricted item is blocked at cart/checkout. Use the
{age}placeholder and it’s replaced with the required age. - Action if age not met — what happens when the visitor fails or declines (default: Redirect to homepage). See step 6.
- Remember verification (days) — defaults to
30. How long a successful verification is remembered before the visitor is asked again. Set0to ask on every visit.
3. Restrict an individual product
The product-level control only appears once the extension is active.
- Open the product in TitanCart → Products and stay on the General tab.
- Expand the Extra section.
- Tick This product is age-restricted.
- Optionally set a Minimum age for this product. Leave it at
0to use the global Default minimum age from step 2. - Save the product.
4. Restrict a whole category
If everything in a category is age-sensitive, restrict the category instead of each product individually.
- Go to TitanCart → Products → Categories and open (or create) the category.
- Tick Products in this category are age-restricted.
- Optionally set a Minimum age for the category. Leave at
0to use the global default. - Save the category.
Every product in a restricted category inherits the requirement automatically — no need to also flag each product.
Note: When a product is restricted by both its own setting and a category it belongs to, the strictest age wins. A 21+ product inside an 18+ category requires 21; an unrestricted product inside a 21+ category requires 21. Each side falls back to the global default when its own minimum age is left at 0.
5. Choose how visitors verify
The Verification method setting controls what the age-gate modal asks for. All three set the same verification once passed:
- Enter date of birth (default) — the visitor enters their date of birth; their age is calculated and compared to the requirement. The strictest of the three.
- Simple “I am over X” confirmation — two buttons: “I am X+ years old” and “I am under X”. One tap to pass.
- Checkbox acknowledgment — a single checkbox (“I confirm I am X years of age or older”) plus a Continue button.
6. Choose what happens when age isn’t met
The Action if age not met setting decides what an underage (or declining) visitor sees:
- Redirect to homepage (default) — sends the visitor back to your storefront home.
- Show denial message — replaces the gate with an “Access Denied” message and keeps them on the page.
- Hide product entirely — the restricted product is hidden from the visitor.
7. (Optional) Gate the entire storefront
For sites where everything is age-restricted (a vape shop, for instance), use the Site-wide Gate section instead of flagging products one by one.
- On the settings page, open the Site-wide Gate section.
- Tick Gate the whole site.
- Set a Site-wide minimum age (leave
0to use the global default). - Optionally customise the Site-wide gate message (the
{age}placeholder works here too). - Save.
Note: The site-wide gate appears before any storefront page — including the login page — so a visitor must verify before they can do anything, even sign in. It uses the same verification cookie as the product and category gates, so one successful verification satisfies all of them. If a specific product needs a higher age than the site-wide minimum, that product will still ask the visitor to step up.
8. How enforcement works (and why it’s hard to bypass)
Age Verification enforces in two places, not just the visible pop-up:
- On the page — the storefront product page shows an age-gate modal.
- On the server — TitanCart re-checks the requirement when a restricted item is added to the cart, and again at checkout against every item in the cart. If the visitor hasn’t verified an age that meets the requirement, the action is blocked with your Warning message.
That server-side guard is the important part: closing the pop-up, deleting the overlay, or posting straight to the cart endpoint won’t let a restricted item through, because the cart and checkout steps verify independently.
9. Test it
- Open your storefront in a private/incognito window so no prior verification is remembered.
- Visit a product you marked as age-restricted (or any page, if the site-wide gate is on). The age-gate modal should appear.
- Pass the check using whichever method you configured — the page should reveal and let you add to cart.
- To test the block, open a fresh incognito window, try to add the restricted item to the cart without verifying, and confirm you see the Warning message.
Troubleshooting
- The “Age restricted” field isn’t in my product editor — the extension isn’t active. The product-level (and category-level) controls only appear once Age Verification is enabled in Installed Extensions.
- A product I didn’t flag is still asking for age — it likely belongs to an age-restricted category. The requirement is inherited from any restricted category the product is in.
- The required age is higher than I set on the product — the strictest age wins across the product and its categories. Check the categories the product belongs to for a higher minimum age.
- Verification keeps re-prompting on every visit — “Remember verification (days)” is set to
0(ask every visit) or the visitor is clearing cookies. Set a positive number of days to remember a pass. - I set a product minimum age but it’s using 18 — a minimum age of
0on the product means “use the global default,” which defaults to 18. Enter the specific age on the product, or change the global Default minimum age. - Enabling the site-wide gate locked me out of the storefront login — that’s by design: the gate is intentionally pre-login. Verify once (it’s remembered for the configured number of days) and you’ll pass through to login normally.
- “Hide product entirely” doesn’t hide the whole site under the site-wide gate — for the site-wide gate, “hide” behaves like “redirect,” because there’s no page left to show; the visitor is sent away instead.
See also
- Setting up reCAPTCHA (v2 & v3) — bot protection for your storefront forms.
- GDPR & cookie consent — privacy and consent settings for your storefront.
- Products overview & the product editor tabs — where the product-level Age restricted field lives.