EARN UP TO 50% COMMISSION WITH OUR RESELLER ACCOUNTS + REGULAR PASSIVE INCOME SIGN UP TODAY

WordPress Platform

5 min read

CookieScan works on any WordPress site – self-hosted, WordPress.com Business/Commerce/Enterprise, or WordPress VIP. Pick the install method that suits your setup.

Before you start

You will need:

  1. An active CookieScan subscription (view plans)
  2. Your CookieScan ID – a unique code provided in your dashboard
  3. Your banner installation code – find it in your CookieScan dashboard:
    • Go to Cookie Banner in the left sidebar
    • Click the Install Code button
    • A popup appears with the code ready to copy

The install code looks like this:

<script src="https://banner.cookiescan.com/js?id=YOUR-COOKIESCAN-ID"></script>

Replace YOUR-COOKIESCAN-ID with the code from your dashboard.

Where it needs to go: in the <head> of every page, before any other 3rd-party scripts (analytics, ads, chat widgets, etc.). This ensures CookieScan loads first and can block cookies until the user consents.

Good news: once CookieScan is installed, you do not need to modify any of your other scripts. CookieScan detects cookies via its built-in scanner (see Cookie Manager in your dashboard) and handles blocking automatically based on user consent.

Method 1: Use a plugin (easiest, no code)

Best for most WordPress users. Safer than editing theme files because a theme update cannot wipe out your changes.

Recommended plugin: WPCode (free, 2 million+ installs)

  1. In your WordPress admin, go to Plugins → Add New
  2. Search for “WPCode”
  3. Click Install Now, then Activate
  4. In the left sidebar, go to Code Snippets → Header & Footer
  5. In the Header box, paste your CookieScan code:
    <script src="https://banner.cookiescan.com/js?id=YOUR-COOKIESCAN-ID"></script>
  6. Click Save Changes
  7. Open your site in a new incognito window – the CookieScan banner should appear

Alternative plugins that do the same job:

  • Insert Headers and Footers by WPBeginner
  • Header and Footer Scripts by DraftPress
  • Head, Footer and Post Injections by Stefano Lissa

They all work the same way – paste the CookieScan snippet into the header section, save, done.

Method 2: Add directly via functions.php

Faster than installing a plugin and no extra dependencies. Always use a child theme so the change survives theme updates.

  1. Go to Appearance → Theme File Editor (or edit functions.php via FTP)
  2. Make sure you are editing your active child theme’s functions.php (not the parent theme)
  3. Add this at the bottom of the file:
/**
 * Load CookieScan banner in the site <head>.
 * Priority 1 ensures it loads before any other head scripts.
 */
function cookiescan_banner_script() {
    ?>
    <script src="https://banner.cookiescan.com/js?id=YOUR-COOKIESCAN-ID"></script>
    <?php
}
add_action( 'wp_head', 'cookiescan_banner_script', 1 );

Replace YOUR-COOKIESCAN-ID with your own ID from the dashboard.

  1. Click Update File
  2. Verify by visiting your site in incognito

Method 3: Install via Google Tag Manager

Good if you already manage tags via GTM. CookieScan provides an official GTM Template so you do not need to write any code.

Step 1 – Get your CookieScan ID

  1. In your CookieScan dashboard, go to Cookie Banner
  2. Click Install Code
  3. Switch to the Google Tag Manager Install tab
  4. Click Copy Key to copy your CookieScan ID

Step 2 – Add the CookieScan template to GTM

  1. Log into Google Tag Manager
  2. Select your container
  3. In the left sidebar, click Templates
  4. Under Tag Templates, click Search Gallery
  5. Search for “CookieScan” and add it to your workspace

Step 3 – Create a new tag using the template

  1. Go to Tags → New
  2. Name the tag “CookieScan Banner”
  3. For Tag Configuration, choose the CookieScan template you just added
  4. Paste your CookieScan ID into the ID field
  5. Triggering: choose Consent Initialization – All Pages

Important: Use Consent Initialization, not All Pages. This fires CookieScan before any other tag, so consent is established before analytics/ads try to load.

  1. Click Save

Step 4 – Submit and publish

  1. Click Submit (top right)
  2. Give the version a name and description
  3. Click Publish

Step 5 – Verify

Use GTM’s Preview mode to confirm the CookieScan tag fires on every page before your other tags.

Verify the installation

In your CookieScan dashboard, open the Cookie Banner → Install Code popup. Step 3 is Verify Installation. Follow it, and the dashboard will confirm whether CookieScan is live.

Alternatively:

  1. Visit your site in a new incognito window
  2. The CookieScan banner should appear
  3. Open browser DevTools (F12) → Network tab → filter by cookiescan
  4. You should see banner.cookiescan.com being loaded successfully

What happens next

Once the banner is live, CookieScan handles the rest automatically:

  • It scans your site (monthly by default) and detects every cookie
  • New cookies appear in your Cookie Manager → Unclassified – move them into the right category (Necessary, Preference, Statistics, Marketing)
  • The banner blocks cookies until the user consents to their category
  • Every consent decision is logged in Consent Log for compliance audits

No manual script tagging required.

Troubleshooting

Banner is not appearing

  • Clear your WordPress cache (WP Rocket, W3 Total Cache, WP Super Cache etc.)
  • Clear your CDN cache (Cloudflare, BunnyCDN, etc.)
  • View page source (Ctrl+U / Cmd+Option+U) and search for cookiescan to confirm the script is present in the <head>
  • Check the browser console (F12 → Console) for errors

Banner keeps reappearing on each page load

  • A caching plugin may be stripping the consent cookie. Clear the cache
  • Check you are not in incognito/private browsing (cookies do not persist between sessions)

Cookies are still loading before consent

  • The banner needs to run before other scripts. Make sure it is near the top of <head>
  • Check it is loaded on every page (not just the homepage)
  • Run a fresh scan in Cookie Manager → Rescan Domain so CookieScan knows about all your cookies

Full documentation

For detailed setup help, go to Cookie Banner → Install Code → support guide in your CookieScan dashboard, or visit our support guides.