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.
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
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “Age Gate”, insert it. Category: Marketing.
- Configure inspector controls that exist on this block. Open Content. Set “Confirm button text”, “Deny button text”, “Deny redirect URL (optional)”, “Disclaimer text”.
- 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
| Control | What the code does |
|---|---|
| Confirm button text | Text field in the inspector. block.json default: Yes, I am old enough. Saved as `confirmText`. |
| Deny button text | Text 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 text | Text field in the inspector. block.json default: By entering, you agree to our Terms & Conditions and Privacy Policy.. Saved as `disclaimer`. |
| Verification mode | Select 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 age | Numeric 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 padding | Numeric range control in the inspector. Range 16–80. block.json default: 48. Saved as `cardPadding`. |
| Card border radius | Numeric range control in the inspector. Range 0–40. block.json default: 16. Saved as `cardRadius`. |
| Title Typography | Shared Blockenberg typography popover (family, size, weight, spacing). Saved as `titleTypo`. |
| Message Typography | Shared Blockenberg typography popover (family, size, weight, spacing). Saved as `messageTypo`. |
| Overlay background | Color control in the inspector. block.json default: rgba(0,0,0,0.75). Saved as `overlayBg`. |
| Card background | Color control in the inspector. block.json default: #ffffff. Saved as `cardBg`. |
| Title color | Color control in the inspector. block.json default: #1e1b4b. Saved as `titleColor`. |
| Message color | Color control in the inspector. block.json default: #64748b. Saved as `messageColor`. |
| Confirm button bg | Color control in the inspector. block.json default: #6366f1. Saved as `confirmBg`. |
| Confirm text color | Color control in the inspector. block.json default: #ffffff. Saved as `confirmColor`. |
| Deny button bg | Color control in the inspector. block.json default: #f1f5f9. Saved as `denyBg`. |
| Deny text color | Color control in the inspector. block.json default: #64748b. Saved as `denyColor`. |
What the front-end script actually does
- The view script reads HTML data attributes: data-opts.
- It writes to localStorage in the visitor’s browser, not to wp_options.
- Keyboard handlers move focus between items.
When this is the right block
- Age verification overlay that protects page content behind a customizable age confirmation dialog — that is the job of Age Gate, not a generic content block.
- Use it when you need the editor control labeled “Confirm button text”, which exists on this block’s inspector.
- Inserter grouping: landing pages, campaign sections, and conversion layouts.
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
Affiliate Disclosure
Styled FTC-compliant affiliate link disclosure notice for articles and reviews. Distinct from Affiliate Review Box — this is the small legal notice, not a full product review.
Affiliate Review Box
Structured product review block with score badge, pros & cons columns, verdict summary, price display, and affiliate CTA button.
Affiliate Section
Affiliate/referral program landing section with commission highlight, how-it-works steps, benefits list, and stats.
Announcement Strip
A thin dismissible announcement bar — ideal above the site header for promotions, launches, or alerts.
App Download
Ready-made app promotion section with iOS / Android badges, device screenshot, heading, subtitle, ratings/reviews, and full background controls.
Badge Wall
Showcase certifications, achievements, awards, or partner logos as a styled badge grid.
Get Blockenberg
Install Blockenberg from WordPress.org, then insert Age Gate from the Gutenberg inserter.