WordPress plugin

Add ConsentTrustee to your WordPress site with a plugin. No code editing required.

The plugin handles script injection, script blocking, and Google Consent Mode v2. You configure everything from the WordPress admin — no need to touch your theme files.

What you get

  • ✓Automatic script injection in the head or footer
  • ✓Script blocking by consent category (statistics, marketing, preferences)
  • ✓Google Consent Mode v2 with Basic and Advanced modes
  • ✓Language override for multi-language sites (works with WPML, Polylang)
  • ✓Clean uninstall — removes all settings when you delete the plugin

Installation

1. Upload the plugin

Download the consenttrustee plugin folder and upload it to your WordPress site. Go to Plugins > Add New > Upload Plugin, or upload the folder directly to /wp-content/plugins/ via FTP.

2. Activate

Go to Plugins in your WordPress admin and activate ConsentTrustee. You will see a Settings link appear next to the plugin name.

3. Enter your domain slug

Go to Settings > ConsentTrustee. Enter the domain slug from your ConsentTrustee dashboard. This is the identifier for your domain, something like my-website-com. Hit save.

That is it. The consent banner will now appear on your site.

4. Configure options (optional)

On the same settings page, you can also configure:

  • Script position — head (recommended) or footer
  • Language override — force a specific language instead of auto-detecting
  • Google Consent Mode — enable GCM v2 in Basic or Advanced mode

Blocking third-party scripts

If you want to block specific scripts until a visitor gives consent, the plugin provides two ways to tag them. Both work through WordPress's script enqueue system, so you do not need to edit your theme templates.

Option 1: Filter

Add this to your theme's functions.php or a custom plugin:

add_filter('ct_script_categories', function ($categories) {
    $categories['google-analytics'] = 'statistics';
    $categories['facebook-pixel']   = 'marketing';
    return $categories;
});

Option 2: Script data

Tag scripts individually when you enqueue them:

wp_enqueue_script('my-analytics', 'https://...');
wp_script_add_data('my-analytics', 'ct_category', 'statistics');

Available categories: statistics, marketing, preferences. Scripts in the necessary category are never blocked.

Caching plugins

The ConsentTrustee script loads from our CDN and runs entirely client-side, so it works with all caching plugins — WP Rocket, LiteSpeed Cache, W3 Total Cache, and others. No special configuration needed.

If you use a plugin that minifies or combines JavaScript, make sure it excludes the ConsentTrustee script. Most caching plugins skip external scripts by default.