---
title: WordPress integration
description: Add consent management to your WordPress site using the official 1Consent plugin.
url: https://1consent.app/docs/integration/wordpress
---

# WordPress integration

Add consent management to your WordPress site using the official 1Consent plugin — no code required.

<WordPressShowcaseLink />

## Installation

### Install the plugin

1. [Download the 1Consent plugin ZIP](/downloads/wordpress/1consent-latest.zip)
2. In your WordPress admin, go to **Plugins → Add New → Upload Plugin**
3. Upload the `.zip` file, click **Install Now**, then **Activate Plugin**

The plugin is distributed from this website. It is not listed in the WordPress.org plugin directory.

### Connect from WordPress

1. Go to **Settings → 1Consent** in your WordPress admin and choose **Connect through 1Consent**
2. A 1Consent tab opens. Sign in or create a free account, choose your site and approve
3. Back in WordPress, the plugin uses the **Live** environment. Check the banner on your website once its Live release finishes deploying.

Automatic connection needs HTTPS on the WordPress site. Nothing needs copying.

#### Set up manually

For WordPress sites without HTTPS, or when your host blocks the automatic connection:

1. Copy your site ID from **Install & verify → WordPress** in 1Consent
2. In WordPress, open **Settings → 1Consent** and enter it under **Advanced delivery → Site ID**
3. Keep **What visitors get** on **Live** and click **Save Changes**

Live and Staging need a release published to that stage. Add your WordPress domain to the site's allowed domains and clear any page cache after changing settings.

## Plugin settings

| Setting | Description |
|---|---|
| **Site ID** | Your public 1Consent site ID. Connecting through 1Consent fills it in |
| **What visitors get** | **Live** (default), **Draft preview** for unpublished changes, or **Staging** for an available Staging release |
| **Draft banner ID** | The GDPR or US Privacy banner to show in Draft preview: choose it under **Install & verify → Script → Preview banner** and copy the ID after `frameworkId=`. Ignored in Live and Staging. Leave empty to follow the site's routing. Preview IAB TCF banners in the signed-in 1Consent Dashboard. |

## How it works

The plugin automatically:

- Injects the 1Consent script into the `<head>` of every page
- Runs at the earliest `wp_head` callback priority; your theme must call `wp_head()` before outputting third-party scripts
- Shows the banner as you configured and published it in 1Consent

## Testing

Use a separate site for testing. The downloaded plugin defaults to production services, including the dashboard connection. A local or development site ID belongs to its matching deployment.

Before connecting WordPress or entering a test site ID, add **all three** settings to `wp-config.php`, before the line that loads `wp-settings.php`. The dashboard origin controls account connection, private reporting and admin links; the other two origins control Live/Staging and Preview banner delivery.

### Local development

```php
define('ONECONSENT_DASHBOARD_URL', 'https://dashboard.1consent.local');
define('ONECONSENT_BOOTSTRAP_URL', 'https://web.cmp.1consent.local');
define('ONECONSENT_PREVIEW_BOOTSTRAP_URL', 'https://cmp.1consent.local');
```

### Development release

```php
define('ONECONSENT_DASHBOARD_URL', 'https://dashboard.1consent.dev');
define('ONECONSENT_BOOTSTRAP_URL', 'https://web.cmp.1consent.dev');
define('ONECONSENT_PREVIEW_BOOTSTRAP_URL', 'https://cmp.1consent.dev');
```

These deployment settings apply to both the banner and the dashboard connection. **Live**, **Preview** and **Staging** select a publication stage within that deployment; choosing Preview does not switch a production plugin to development services. Keep normal HTTPS certificate validation enabled, including when testing locally.

Remove the overrides when moving the WordPress site to production, then connect to the production site or enter its production site ID. A normal production installation needs no origin overrides.

## Template-based blocking (advanced)

For performance-optimized setups, wrap third-party scripts in your theme with `<template>` tags:

```html
<template data-1c-service-tag="google-analytics">
  <script src="https://www.googletagmanager.com/gtag/js?id=GA_ID"></script>
</template>
```

This prevents scripts from loading until the user grants consent for the associated service.

## Troubleshooting

### Banner not appearing

- Verify the **Site ID** under **Settings → 1Consent → Advanced delivery**
- Check that the plugin is activated
- Ensure no caching plugin is serving a stale page — clear your cache

### Conflicts with other plugins

The 1Consent plugin is designed to be lightweight and non-intrusive. If you experience conflicts:

- Inspect the page source and ensure the 1Consent script appears before third-party scripts; a plugin cannot run before scripts hardcoded ahead of `wp_head()`
- Disable other consent/cookie plugins that may interfere

Need help? Reach out via the [1Consent dashboard](https://dashboard.1consent.app) or write to us through the [contact page](/contact).
