Site-wide age verification
Configure a wallet disclosure that grants temporary access to WordPress pages and REST content.
Site-wide age verification uses a separate disclosure plugin. It requests an over-18 attribute through a wallet disclosure and grants temporary browser access after a verified positive result. It creates no WordPress account and does not require a birthdate.
This gate covers public pages rendered by WordPress and REST responses. It does not provide product-specific WooCommerce checkout restrictions. Page caches, CDNs, static files and direct media URLs need the separate access rules described below.
How it works
WordPress creates a confidential disclosure intent with a fresh challenge and PKCE. It validates the signed result against the configured flow, organization, trusted signing issuer, audience and challenge. Only boolean true at mapping.ageOver18.value grants access. The browser permission lasts at most five minutes and expires sooner if the signed result does.
Install the disclosure plugin
Install WordPress age-disclosure plugin 0.1.1 (ZIP) through Plugins → Add New → Upload Plugin, then activate it. This package is needed for the age gate; standard OIDC login does not provide that feature. It bundles firebase/php-jwt 7.2.1. Use PHP 8.3 with OpenSSL and Sodium, HTTPS and working WordPress permalinks.
Choose the site-wide disclosure route or the standard OIDC login route for this setup; do not enable both wallet buttons.
Before you begin
Use a separate Studio disclosure and its own credentials. The WordPress login callback and authentication flow are not interchangeable with this disclosure. Keep the site's independent password-based administrator login available.
This example uses Yivi. The wallet must hold the trusted pbdf.gemeente.personalData.over18 attribute. Configure the exact attribute and mapping below; the display label Yes / No is not a positive value.
Configure Ver.iD
- Create a disclosure dedicated to this age check. Select Yivi and only
pbdf.gemeente.personalData.over18from the intended trusted issuer. - Create a mapping whose input key and output claim are both
ageOver18. - Use this function for the verified attribute input:
(attributeData) => attributeData.ageOver18 === 'Yes';The function accepts the exact raw value Yes and returns boolean false for every other input. Do not use a truthiness check, join the attributes into a string or return the strings "true" and "false".
- Attach that mapping to the disclosure. Add an active brand and an OAUTH secret.
Register the age callback
Open Settings → Wallet connection and copy Age callback:
<wordpress-base-url>/verid-wallet/age-callbackIn Ver.iD Studio → Verify → Disclosures → your flow → Redirect URIs, add that exact HTTPS URL, then activate the flow. Retain the authentication callback on its separate flow if you use it on another site.
Configure age mode
Under Age disclosure, enter:
| Setting | Value |
|---|---|
| Age issuer | https://ssi.oauth.ver.id/ |
| Disclosure client ID | The dedicated disclosure flow's client identifier |
| Disclosure client secret | Its attached OAUTH secret's Key (as base64url) value |
| Trusted disclosure token issuer | The signing issuer supplied by your Ver.iD deployment administrator |
| Organization UUID | The Studio organization that owns the disclosure |
The trusted token issuer may be a URN and is different from the HTTPS discovery issuer. Obtain it from trusted configuration; do not copy it from an unverified token.
Set Mode → Site-wide age verification and select Save configuration. The login settings remain stored separately, but the wallet-login button is inactive in age mode.
Complete the age journey
- Open a public page in a new private window. It should show the age gate with Verify I am 18 or over.
- Select the button, scan the request with Yivi and approve the over-18 attribute.
- Continue in the original browser. A positive signed result should return you to the requested page.
- Open another page and a REST content URL in that browser. Both should follow the same permission policy.
- Wait until the permission expires, then request the URLs again. Access must be blocked until a new successful disclosure.
Cancellation, a negative or missing result and an expired request must not grant access. Test those branches separately. Use [verid_age_verification] to show the button in content rendered by WordPress.
Check caches and direct routes
Bypass page and CDN caching for protected responses so every request reaches the server-side gate. A cache can otherwise return content before WordPress executes.
Request protected HTML and REST URLs directly from a fresh browser with no age permission, and again after expiry. They must remain blocked. A copied URL or manually entered browser value must not grant permission.
Configure your web server or content delivery layer separately if media or static files must also require age verification. Normal administration, password login and the connector's callbacks stay reachable by design; administrator access follows WordPress's own authentication policy.