Installing on WordPress
There are three ways to add One Privacy to a WordPress website. Pick the one that matches how comfortable you are editing your site.
Get your script
In One Privacy, open Scripts and copy the Production snippet.
The snippet looks like:
<script data-oneprivacy-widget="true" src="https://.../live/<projectId>/sdk.js"></script>
Option 1: Use a header scripts plugin (easiest)
Most WordPress sites already have a plugin that lets you add scripts to the header. If yours does, this is the easiest path.
Common plugins: Insert Headers and Footers, WPCode, Header Footer Code Manager.
- Open your WordPress admin area.
- Open the plugin's settings page.
- Find the field labelled Scripts in Header (or similar).
- Paste the One Privacy snippet.
- Save.
That's it. The banner now loads on every page.
Option 2: Use Google Tag Manager
If your site already loads GTM, follow Installing with Google Tag Manager instead. This keeps all your scripts in one place.
Option 3: Edit the theme directly
If you don't want to install a plugin and don't use GTM, your developer can add the snippet directly to your theme.
- In your WordPress admin, go to Appearance → Theme File Editor.
- Open
header.php. - Paste the snippet inside the
<head>tag, near the top. - Click Update File.
Verify it works
Open your live website in a fresh browser session (incognito works well). The banner should appear within a couple of seconds.
See Verifying the banner is live.
WP Consent API
WordPress has a shared consent standard, the WP Consent API. Plugins that support it (analytics, marketing, forms, and others) read the visitor's choice from it and hold their cookies until consent is given.
One Privacy drives the WP Consent API when it is present. On every page load with a saved choice, and each time a visitor accepts, rejects, or saves settings, One Privacy sets the consent type to opt-in and writes each category with wp_set_consent().
To turn it on, install and activate the free WP Consent API plugin from the WordPress plugin directory. No other setup is needed. If the plugin is not installed, One Privacy skips this step.
The mapping from One Privacy categories to WP Consent API categories:
| One Privacy category | WP Consent API category |
|---|---|
| Strictly necessary cookies | functional (always allowed) |
| Functional cookies | preferences |
| Performance cookies | statistics and statistics-anonymous |
| Targeting cookies | marketing |
Plugins that load Google tags follow the visitor's choice through Google Consent Mode, with or without the WP Consent API.