Marketing · Gutenberg

Age Gate block for WordPress

Age verification overlay that protects page content behind a customizable age confirmation dialog.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Age verification overlay that protects page content behind a customizable age confirmation dialog.

Inspector panels on this block: Content, Gate Settings, Card Style. Those titles come from index.js, not from a shared template.

Behavior controls: “Verification mode” options: Yes / No buttons, Date of birth input.

Where to find it

Gutenberg inserter → Marketing → search “Age Gate” (block name `blockenberg/age-gate` in block.json). Style it in the sidebar after insert.

How to use Age Gate block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Age Gate”, insert it. Category: Marketing.
  3. Configure inspector controls that exist on this block. Open Content. Set “Confirm button text”, “Deny button text”, “Deny redirect URL (optional)”, “Disclaimer text”.
  4. Check the published page. The view script reads HTML data attributes: data-opts. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Confirm button textText field in the inspector. block.json default: Yes, I am old enough. Saved as `confirmText`.
Deny button textText field in the inspector. block.json default: No, take me back. Saved as `denyText`.
Deny redirect URL (optional)Text field in the inspector. Saved as `denyRedirectUrl`.
Disclaimer textText field in the inspector. block.json default: By entering, you agree to our Terms & Conditions and Privacy Policy.. Saved as `disclaimer`.
Verification modeSelect control; the chosen value is saved on the block. Options: Yes / No buttons; Date of birth input. block.json default: yesno. Saved as `verificationMode`.
Minimum ageNumeric range control in the inspector. Range 13–21. block.json default: 18. Saved as `minimumAge`.
Remember choice for (days)Numeric range control in the inspector. Range 0–365. block.json default: 30. Saved as `rememberDays`.
Logo URL (optional)Text field in the inspector. Saved as `logoUrl`.
Logo max height (px)Numeric range control in the inspector. Range 30–200. block.json default: 80. Saved as `logoSize`.
Card max-width (px)Numeric range control in the inspector. Range 300–800. block.json default: 480. Saved as `cardMaxWidth`.
Card paddingNumeric range control in the inspector. Range 16–80. block.json default: 48. Saved as `cardPadding`.
Card border radiusNumeric range control in the inspector. Range 0–40. block.json default: 16. Saved as `cardRadius`.
Title TypographyShared Blockenberg typography popover (family, size, weight, spacing). Saved as `titleTypo`.
Message TypographyShared Blockenberg typography popover (family, size, weight, spacing). Saved as `messageTypo`.
Overlay backgroundColor control in the inspector. block.json default: rgba(0,0,0,0.75). Saved as `overlayBg`.
Card backgroundColor control in the inspector. block.json default: #ffffff. Saved as `cardBg`.
Title colorColor control in the inspector. block.json default: #1e1b4b. Saved as `titleColor`.
Message colorColor control in the inspector. block.json default: #64748b. Saved as `messageColor`.
Confirm button bgColor control in the inspector. block.json default: #6366f1. Saved as `confirmBg`.
Confirm text colorColor control in the inspector. block.json default: #ffffff. Saved as `confirmColor`.
Deny button bgColor control in the inspector. block.json default: #f1f5f9. Saved as `denyBg`.
Deny text colorColor control in the inspector. block.json default: #64748b. Saved as `denyColor`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Age Gate block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Age Gate”. It sits under Marketing. After insert, open Content and set “Confirm button text”, “Deny button text”, “Deny redirect URL (optional)”, “Disclaimer text”.

Where does Age Gate store visitor state?

In localStorage on that browser. Clearing site data resets it. It is not a WordPress user meta field unless render.php says so.

Is the Age Gate Gutenberg block free?

Yes. Age Gate ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Age Gate to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Content, Gate Settings, Card Style).

Related marketing blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Age Gate from the Gutenberg inserter.

Get Blockenberg