1ConsentConsentDocs

WordPress Integration

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

Installation

Install the plugin

  1. Download the 1Consent plugin 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.

Configure your App ID

  1. Go to Settings → 1Consent in your WordPress admin
  2. Enter your App ID from your app's Installation page in the 1Consent dashboard
  3. Choose Live, Preview, or Staging, then click Save Changes

Open your site's frontend to verify the banner. Live and Staging require a configuration published to that stage. Preview loads your unpublished changes. Add your WordPress domain to the app's allowed domains and clear any page cache after changing settings.

Plugin settings

SettingDescription
App IDYour unique 1Consent application identifier
StageLive (default), Preview for unpublished changes, or Staging for an available Staging publication

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
  • Respects your CMP configuration from the 1Consent dashboard

Testing

Use a separate app for testing. Local and develop WordPress installations must use their matching CMP environment, while the downloadable plugin defaults to the production CMP.

Site operators can set ONECONSENT_BOOTSTRAP_URL in wp-config.php to the bootstrap origin for their environment. This is a deployment setting, separate from the Live/Preview/Staging selector.

Template-based blocking (advanced)

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

<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

  • Verify your App ID is correct in Settings → 1Consent
  • 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 or email [email protected].

On this page