Skip to content

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

Install CookieScan

Install CookieScan on WordPress

Add the CookieScan install code to the head of every WordPress page, with a header plugin such as WPCode or in your child theme.

Updated 3 min read

Applies to:
  • Cookie banner

https://cookiescan.com/help/install-on-wordpress/ Β· Updated 12 October 2026

On this page

Before you start

There is no CookieScan plugin for WordPress. You add the CookieScan install code to the <head> of every page, with a header plugin or in your theme.

You need:

  • your install code, from Cookie Banner, then Install Code, then Manual Install
  • a WordPress administrator account that can add plugins or edit theme files

If you manage your tags in Google Tag Manager, follow Install with Google Tag Manager instead. You don't need either method below.

Add the code with WPCode

WPCode is a free plugin that adds code to your website's header. Other header plugins work the same way. A theme update can't remove code you add this way.

  1. Install the WPCode plugin

    In WordPress, go to Plugins and select Add New Plugin. Search for WPCode, select Install Now, then Activate.

  2. Open Header & Footer

    Go to Code Snippets, then Header & Footer.

  3. Paste the install code

    Paste your install code into the Header box.

  4. Save the change

    Select Save Changes.

The install code looks like this:

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

Add the code in your theme

You can add the code in your theme's functions.php file instead. Use a child theme, so a theme update doesn't remove your change.

Warning: Back up first

A mistake in functions.php can stop your website loading. Keep a copy of the file before you change it.

  1. Open your child theme's functions.php

    Use your hosting file manager, or the theme file editor in WordPress.

  2. Add the code below

    Paste it at the end of the file, with your CookieScan ID in place of YOUR-COOKIESCAN-ID.

  3. Save the file

    Save it, then check your website still loads.

Text
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 );

The 1 at the end puts the CookieScan script near the top of <head>, before most other scripts.

Keep CookieScan first and up to date

WordPress plugins can move, delay or cache scripts. Check these after you add the code:

  • Other plugins may add scripts above CookieScan. View your page's source and check that the CookieScan script comes first in <head>.
  • If a performance plugin delays, defers or combines JavaScript, exclude banner.cookiescan.com from it.
  • Clear your caching plugin's cache, and any CDN cache, so visitors get the new page.

Auto-blocking can only hold back scripts that load after CookieScan. See Tags fire before visitors consent.

Check it worked

Open your website in a private browser window. Your cookie banner appears within a few seconds. Make a choice, then check that the Dashboard shows Receiving consents. See Check your banner is working.

Next steps

Was this article helpful?

Thanks for your feedback.

Please don't include personal details. We can't reply here.

Thanks for your feedback.

Please don't include personal details. We can't reply here.

Thanks, your comment has been sent.

Sorry, we couldn't record your feedback. Please try again later.

Still stuck?

Our support team can help with anything these guides don't cover. Tell us your CookieScan ID and the page address so we can look straight away.

Back to Install CookieScan