Description
Verify your customers’ age with MitID in WooCommerce. Aldersverificering connects your store to a MitID verification flow, so customers can confirm their age before buying age-restricted products.
Built for webshops serving customers who use MitID in Denmark. Set the required age for your store, categories, products or individual variations — including 16+ and 18+ checks.
How MitID age verification works
- Your checkout requests an age check. The plugin uses your product rules and configured delivery policy to decide whether verification is required.
- The customer confirms with MitID. The familiar MitID flow opens in a popup or redirects the customer to verification.
- WooCommerce checks the result. When verification is required, checkout continues only with a valid result that meets the required age. Cancelled, missing or insufficient results do not grant access to checkout.
This is a MitID-based age check, rather than a checkbox where customers declare their own age. Customers must be able to use MitID; the plugin does not provide passport or foreign ID-card verification.
Free plugin and test environment
The plugin is free software. An Aldersverificering.dk account and API key are required. Test the MitID flow for free with test keys and MitID test identities. Real production verifications require a paid service plan. See service pricing. Payment is for the external verification service, not for unlocking plugin code.
MitID features for WooCommerce
- MitID age verification with server-side validation of the signed result
- Works with both classic WooCommerce checkout and the modern Checkout Block
- Compatible with WooCommerce HPOS (High-Performance Order Storage)
- Two targeting modes:
- All products — every checkout requires verification
- Selected products & categories — gate only specific items
- Per-product, per-category, and per-variation age overrides
- Target individual age-restricted variations without gating their sibling variations
- Four-tier age resolution: store default gated category override parent product override variation override
- Test and production environments with separate API keys
- Popup and redirect verification flows
- Optional delivery outside Denmark without MitID, with server-side destination checks
- Accessible age-verification interface with the documented official MitID CTA
- Danish and English storefront strings; admin UI fully translatable
- WPML and Polylang compatible
- Site-specific API keys and settings; Multisite compatibility has not been verified
The plugin provides technical age verification. Merchants remain responsible for their product rules, delivery destinations and applicable requirements.
External services and data
Aldersverificering.dk / UNQVerify
This service starts the MitID verification flow and returns a signed verification result. After you configure an API key, the customer’s browser contacts api.aldersverificering.dk or test.api.aldersverificering.dk when verification starts. The request sends the store’s public API key, the required age and the store callback URL (/unqverify/callback/). The API returns the broker authorization URL, which opens in a popup or redirects the browser. The customer completes authentication with the configured MitID broker, and the result returns to the store callback.
The browser and WordPress server also request public signing keys from the corresponding API host at /well-known/openid-configuration/jwks to validate verification tokens. The service processes the verification result, age-related claims and technical session/event identifiers; its event history supports operation and service billing. These requests also expose connection information, such as the requesting IP address, and browser-supplied headers to the receiving host. The plugin does not send the cart contents, order number or shipping/billing address in the verification-start request.
See the service website, pricing and Privacy Policy. Contact the service provider at info@aldersverificering.dk for the applicable service terms before enabling production.
Bundled SDK and readable source
The service SDK (version 0.4.3) is included in this plugin and served from the store’s own WordPress installation, with Subresource Integrity verification. It loads on gated cart/checkout pages when the plugin initializes verification, and on the callback page. No external CDN request is needed to download the SDK. The plugin’s CSS, MitID logo and font are also served locally.
The exact TypeScript source, locked dependencies, build instructions and MIT license notices for the SDK and its bundled dependencies are included under assets/vendor/unqverify-sdk/source/. See BUILD.md in that folder to reproduce the distributed JavaScript. The bundled SDK is byte-identical to the previously used 0.4.3 distribution; the verification API remains an external service as described above.
Browser and store storage
After successful verification, the SDK stores the signed result in the unqverify_token cookie on the store domain. The plugin reads this token to check the verification result, required age and expiry. It does not write the JWT to the WordPress database. When the optional foreign-delivery setting is enabled, it records whether the delivery check ran, the satisfied age requirement and a hash of the active public key on the order, allowing a valid order to retry payment after the browser token expires. Order verification metadata is retained when the plugin is deleted; plugin settings, targeting metadata and signing-key caches are removed when no other known installation copy remains. Merchants should describe this integration in their own privacy information.
Installation
- Install Aldersverificering – MitID Age Verification for WooCommerce from Plugins > Add New, or upload the ZIP from this page.
- Activate the plugin via Plugins > Installed Plugins.
- Navigate to WooCommerce > Settings > Aldersverificering.
- Create an Aldersverificering.dk account, enter your test API key and save.
- Set the required age, select the products or categories to verify, and choose a popup or redirect flow.
- Complete a test checkout with a MitID test identity before enabling production.
When you are ready to go live, enter your production API key and toggle the environment to Production.
FAQ
-
Does this plugin verify age with MitID?
-
Yes. Customers complete a MitID flow through the Aldersverificering.dk service. The plugin validates the signed result and required age before allowing a checkout that requires verification. It does not rely on a self-declared date of birth or an “I am over 18” checkbox.
-
Do customers need MitID?
-
Yes, customers must be able to complete the MitID flow when verification is required. This plugin does not verify passports or foreign identity cards. For eligible orders delivered outside Denmark, see the optional delivery setting below.
-
Is MitID age verification free?
-
The plugin and test environment are free. Real MitID verifications in production require an Aldersverificering.dk account, a production API key and a paid service plan. See current prices.
-
I already use the GitHub version. Can I install this alongside it?
-
No. The existing GitHub package uses a different installation folder. Continue using its updates until an assisted switch is arranged with support. Back up the store and pause checkout during the switch. Do not delete the old copy through WordPress: older versions’ uninstall routines remove shared settings and product rules. An automatic migration between the two installation identities is not provided.
-
Where do I get an API key?
-
Sign up at Aldersverificering.dk to receive test and production API keys.
-
Does this work with the WooCommerce Checkout Block?
-
Yes. The plugin validates age verification server-side via the Store API checkout hook, so it works with both the classic shortcode checkout and the modern Blocks-based checkout.
-
Can customers order for delivery outside Denmark without MitID?
-
Enable Allow delivery outside Denmark without MitID under WooCommerce > Settings > Aldersverificering. This option is off by default. It adds a secondary text link to the cart dialog and lets customers enter their delivery address before verification. The final shipping destination is checked before payment: Danish delivery, local pickup and age-restricted virtual products still require verification. A foreign billing address alone does not grant an exemption. Enable this option only where your products and destination-country requirements permit it. Custom checkout and express-payment integrations need their own compatibility test.
-
Can I require a different age for different products?
-
Yes. In selected products & categories mode you can set category, product and variation age overrides. The most specific rule wins: variation override > parent product override > category override > store default.
-
What happens if the customer closes the verification popup?
-
The customer can try again. When the delivery policy requires verification, checkout is rejected unless a valid, unexpired token or an applicable previously recorded order verification is accepted. Permitted foreign deliveries can proceed without MitID. An existing pending order can still require verification before a payment retry.
-
Does the plugin work in a WordPress Multisite installation?
-
Multisite compatibility, including network activation and network-wide uninstall cleanup, has not been verified. Settings and API keys are site-specific. Test your Multisite setup before use; the plugin does not claim to prevent network activation.
-
Does it work with WPML or Polylang?
-
Yes. When WPML or Polylang is active the plugin automatically resolves translated
products to their source-language variant before reading per-product age gate settings.
This ensures age gate flags and age overrides set on a product apply to all translations
of that product. -
Does the plugin store personal data?
-
The plugin uses a signed verification cookie and, when the optional foreign-delivery setting is enabled, order verification metadata. It does not store the JWT in the WordPress database. See External services and data above for browser, service and store processing, and the service’s Privacy Policy.
-
Yes. The button that starts the MitID client uses the supplied official white MitID logo, MitID blue, IBM Plex Sans SemiBold, a permitted Danish/English CTA text, and the preferred 4 px radius. Neutral WooCommerce controls that only open the explanatory dialog are not presented as MitID buttons. The MitID client itself is rendered by the configured broker after the verification flow starts.
-
What cleanup happens when I delete the plugin?
-
Plugin options, category gating meta, product gating meta, and JWKS cache are removed via the included
uninstall.phpwhen no other known installation copy remains. This version preserves shared data if the alternative installation copy is still present; older versions do not provide that protection.
Order verification metadata is retained as part of the historical order record.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Aldersverificering – MitID Age Verification for WooCommerce” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Aldersverificering – MitID Age Verification for WooCommerce” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.2.1
- Enqueued scoped admin scripts, limited configuration notices to relevant screens, and removed duplicate subscription prompts.
- Standardized internal class and JavaScript prefixes while preserving existing merchant settings and product/order metadata.
- Adopted standard WordPress language-pack loading for the directory distribution.
- Matched the WordPress.org package and translation domain to the assigned directory slug while preserving a separate update package for existing GitHub installations.
- Prepared metadata and documentation for WordPress.org review.
- Aligned the translation text domain with the requested plugin slug and migrated Danish translations.
- Preserved category age-verification settings when saving category Quick Edit.
- Documented the paid external service, network requests, SDK delivery and verification storage.
- Bundled the unchanged SDK 0.4.3 locally with reproducible source and dependency licenses.
- Registered callback scripts through WordPress, preserved SDK integrity checks on WordPress 6.0 and hardened error-output handling.
- Fixed popup completion being ignored after an early window-close signal; scoped result channels and timeout cleanup to each verification attempt.
- Excluded checkout from WordPress speculative loading so a pre-verification redirect cannot send verified customers back to the cart.
- Removed the unverified claim that Multisite network activation is prevented.
1.2.0
- Added an opt-in setting for delivery outside Denmark without MitID, enforced against the final shipping destination in classic checkout and Store API.
- Added a secondary underlined delivery link, shorter explanatory text and an italic delivery-address footnote in Danish and English.
- Kept verification required for Danish delivery, local pickup and age-restricted virtual products.
- Added order verification records and payment-retry checks, including Store API payment of existing orders.
- Added delivery-policy tests and isolated local checkout fixtures with settings restoration.
1.1.2
- Implemented the official MitID CTA for starting verification with the supplied white logo, fixed MitID blue, IBM Plex Sans SemiBold, and preferred 4 px radius.
- Changed the CTA text to the documented
Confirm with MitID/Bekræft med MitIDoptions. - Kept the popup new-window notice, accessibility behaviour, and existing SDK/security flow unchanged.
1.1.1
- Replaced the potentially ambiguous MitID-labelled storefront CTA with a merchant-neutral age-verification button.
- Added a Danish/English new-window notice before popup verification.
- Added a shared accessible modal with focus trapping, focus restoration, live status messages, responsive styling, and documented theme variables.
- Added automated accessibility and classic/Blocks storefront UI tests.
1.1.0
- Added per-variation age-gate rules for variable WooCommerce products.
- Added variation-level age overrides and parent/category inheritance guidance.
- Fixed release ZIP packaging and added CI verification gates.
1.0.0
- Extracted all helper functions into
includes/functions.phpfor cleaner code organisation. - Registered all plugin options via
register_setting()with sanitize callbacks (WordPress.org submission requirement). - Added
current_user_can()capability checks in all settings and meta save handlers. - Fixed JWKS stale-cache option to not autoload (
update_option(..., false)). - Added term-meta cache pre-warming on the Products list screen to eliminate N+1 queries.
0.2.0
- Added WPML and Polylang support: translated products resolve to source-language post for per-product meta reads.
- Added per-request cart cache invalidation on
woocommerce_cart_updated,woocommerce_add_to_cart, etc. — prevents stale gating results when other plugins modify the cart mid-request. - Added jQuery availability guard to cart.js and checkout.js — prevents ReferenceError on stores where performance plugins defer jQuery loading.
- Added the initial Multisite header declaration; the claim that it prevented network activation was corrected in 1.2.1.
- Added three-tier age resolution: store default category override product override.
- Added per-category and per-product age override fields in the WooCommerce admin.
- Added age gate columns on the Products and Product Categories list screens.
- Added status indicator badge in the per-product meta box.
- Fixed JS enqueue bug: cart/checkout scripts were loaded on all pages regardless of targeting mode.
- Added TEST MODE banner to the verification modal when using a test API key.
- Improved admin column badges to accurately reflect the source of the gating rule.
- Added
uninstall.phpto clean up all plugin data on deletion. - 60 unit tests covering settings, cart gating, age resolution, and JWT validation.
0.1.0
- Initial release.
- MitID age verification for WooCommerce checkout (classic + Blocks).
- HPOS and Cart/Checkout Blocks compatibility declarations.
- Popup and redirect verification modes.
- All-products and selected-products/categories targeting modes.
- Test and production environment switching.
