Omea Consent Pro · Guides

Age gate for WordPress (age confirmation popup)

Add an age gate to WordPress with Omea Consent Pro: yes/no or date of birth, a minimum age per country, chosen pages only. A self-declaration, not verification.

Updated · Omea Consent Pro 1.0.8

On this page
  1. Add an age gate
  2. Settings and defaults
  3. How it works
  4. Minimum age by country
  5. Where it shows
  6. Last 30 days

Sites that promote alcohol, tobacco or vaping products often show an age notice before visitors enter. Omea Consent Pro includes an age gate that matches your cookie banner and stays in place when a visitor blocks scripts. Since Pro 1.0.7 it can ask for a different minimum age per country, show only on the pages, categories or products you choose, and count answers per country. Visitors confirm their age themselves – it is a self-declaration, not age verification. If you sell age-restricted products online, or publish adult or gambling content, the law usually requires a real age check as well – see the note at the end.

Add an age gate

  1. Open Age Gate Go to Omea Consent › Age Gate and switch on the Age gate card.
  2. Set the minimum age Enter the Minimum age – 18 by default.
  3. Choose how visitors confirm their age Under How visitors answer pick Simple confirmation (yes / no) or Date of birth.
  4. Decide how long to remember Set Remember for in days – 30 by default; 0 asks on every visit.
  5. Set ages per country (optional) In Minimum age by country, enter a two-letter Country code and its Minimum age – for example US and 21.
  6. Choose where it shows Under Where it shows, keep Every page or pick Only the pages, categories and products selected below. Add pages that should never be gated under Never on.
  7. Write the texts Edit the Heading, Message and Buttons. Use {age} to insert the minimum age.
  8. Handle under-age visitors Under If the visitor is too young, enter a Redirect to address, or leave it empty to show a message instead. Click Save changes.

A live preview on the right shows the gate as you edit.

Settings and defaults

Setting Default
Minimum age 18 (1–99)
How visitors answer Simple confirmation (yes / no)
Remember for 30 days (0–365; 0 asks every visit)
Minimum age by country None – everyone gets the minimum age above
Where it shows Every page
Heading Please confirm your age
Message You must be {age} or older to enter this site.
Buttons I am {age} or older / Leave (with Date of birth: Continue / Leave)
Redirect to https://www.google.com
Too-young message Sorry, you are not old enough to view this site.

Tick Show site name above the heading to add your site’s name to the gate. The built-in texts follow the plural rules of each language for the age shown (Polish 18 lat but 22 lata, for example); if you save a built-in text unchanged, it keeps adapting when you change the minimum age later.

How it works

  • The gate is part of the HTML of every page it applies to, so it’s there even if a visitor blocks JavaScript. The page content is still delivered with it, though, so the gate is not an access control.
  • Works with page caching (LiteSpeed Cache, WP Rocket, your host’s cache): the visitor’s browser checks whether they’ve already passed, so a cached page shows the gate to a new visitor and not to one who has passed. No need to exclude pages from the cache. Until the gate appears, the page stays covered – content never flashes.
  • Keyboard and screen readers: focus moves into the gate (the date field or the confirm button) and Tab stays inside it until the visitor answers. A refusal message is read out.
  • With Date of birth, the age is calculated in the visitor’s browser. The date is never sent to your server or stored – only the minimum age goes into the cookie.
  • A passed check is remembered in the omea_age_gate_ok cookie for the period you set. It stores only the minimum age (for example 18), nothing that identifies the visitor. If you raise the minimum age, visitors are asked again – and with ages per country, a visitor confirmed at 18 is asked again where 21 applies (one confirmed at 21 isn’t asked again where 16 applies). Mention the cookie in your cookie policy; if you keep it longer than a session, say so in the gate’s message (for example “We remember your answer for 30 days”).
  • The gate uses your cookie banner’s theme and colours from Settings › Appearance: a dark or light box, a filled confirm button and an outlined leave button.

Minimum age by country

In the Minimum age by country card, set a different age where the law sets one – for example 21 in the United States for alcohol. Enter a two-letter country code (ISO 3166, such as US, DE, GB) and the age; leave a row empty to remove it, and save to get more empty rows. Visitors from other countries, or whose country can’t be told, get the Minimum age above.

The country comes from the same lookup as the rules per region: your CDN’s country header (Cloudflare, for example), Omea Analytics’ location database, or the free DB-IP country database, which Pro downloads to your server once you set ages per country. Only the country code is used. It’s decided in the visitor’s browser, so page caching stays safe, and kept there for the session in the omea_consent_region cookie – not stored on your server. If the lookup fails, the default minimum age applies.

Where it shows

In the Where it shows card, Show on is Every page by default. Choose Only the pages, categories and products selected below to gate only:

  • Pages you tick,
  • Post categories – the category pages and every post in them, including subcategories,
  • WooCommerce – The shop, every product and product category, or only the Product categories you tick (with their products and subcategories).

Pages under Never on are never gated – your imprint or terms, for example. Your privacy policy page and Omea’s cookie policy page are never gated either, so anyone can read them.

Developers can still decide per request with the omea_age_gate_should_show filter, which runs after these settings. It runs on the server, so base it on the page (not on the visitor): a page cache keeps what the filter decided for that page.

Last 30 days

The Last 30 days card shows how visitors answered: Confirmed their age, Chose to leave and Too young (date of birth), with a table per country. In the plugin’s words: “counted per day and country. Nothing that identifies a visitor is kept.” Daily counts are kept for 90 days.

An age gate is a self-declaration, not age verification. Visitors say how old they are; nothing checks it. Many laws don’t accept that:

  • Adult content: France, Germany, the UK, Brazil (from 17 March 2026) and many US states require a real age check; France, the UK and Brazil say expressly that a self-declaration is not enough.
  • Gambling: licensed operators must identify their players.
  • Selling alcohol, tobacco or vapes online: the law usually requires an age check at sale or delivery – for example ID or database checks and an adult signature on delivery for tobacco and vapes in the US, and a ban on mail-order sales of tobacco and e-cigarettes to minors in Germany. In Brazil, from 17 March 2026, a self-declaration is not allowed for any product minors may not buy.

In those cases, use an age-assurance service that meets the local standard (for example an ID document or eID check, a bank or credit-reference check, or facial age estimation) as well as, or instead of, the gate. Check what your market and products legally require.

Sources: UK Online Safety Act 2023, s.230; Brazil Lei 15.211/2025, art. 9.