Cookiebot WordPress plugin implementation

You can use the official Cookiebot WordPress plugin to implement the cookie consent banner and cookie declaration on your website. Alternatively you can implement Cookiebot with Google Tag Manager or direct in your websites HTML template.

After implementing the Cookiebot plugin, you can also use the CookieInfo custom banner designs.

Cookiebot WordPress implementation

Cookiebot offers a WordPress plugin that makes your website compliant with GDPR/ePR and CCPA.
You can use the Cookiebot WordPress plugin to handle user consents and give users the option to opt in and out of cookie categories.

Cookiebot scans your website to find all cookies and tracking technologies. They are then automatically blocked until your users choose which categories of cookies to accept.
The cookie declaration includes the option for a Do Not Sell My Personal Information link – offering full compliance with GDPR/ePR and CCPA.

Cookiebot WordPress plugin

Download, install and activate the Cookiebot WordPress plugin

Once activated navigate to the settings tab of the plugin and insert your Cookiebot ID which you can find in the Cookiebot manager. It looks like this: data-cbid="00000000-0000-0000-0000-000000000000".

When using advanced functionalities please read the official Cookiebot WordPress plugin page.

Manual implementation

Add your personal Cookiebot script for the consent dialog. Your script is available in the Cookiebot manager under ‘Your scripts’. Please choose whether you want to use automatic blocking mode or manual blocking mode. Add your preferred script to the WordPress theme file “header.php” inside the <head>-tag and before the wp_head() call, e.g. (marked in bold):  

<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<title><?php wp_title(); ?></title>
<link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen" />
<script id="CookieConsent" src="https://consent.cookiebot.com/uc.js" data-cbid="00000000-0000-0000-0000-000000000000" type="text/javascript" async></script>
<?php wp_head(); ?>
</head>

* Please note that this example doesn’t use automatic cookie blocking mode When saved, the cookie consent banner will display on your website. If you have used Automatic Cookie Blocking Mode you may skip ahead to Showing your cookie declaration in full on a separate WordPress page or post.

To hold back plugin-cookies until the visitor has consented, script tags within the plugin must be marked up with the tag attribute “data-cookieconsent”. The value of this attribute must be set to one or more of the following values (comma-separated) which must reflect the type(s) of cookies being set by the script tag: preferences, statistics, marketing. Finally the “type”-attribute of the script tag must be set or changed to “text/plain” (highlighted in bold). Example: 

<script type="text/plain" data-cookieconsent="marketing" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>

 In WordPress, script tags may also load from plugins with the function wp_enqueue_script. In that case you can make the necessary modifications to the script tag using the filter script_loader_tag. PHP plugin example: 

wp_enqueue_script('addthis_widget.js', $script); 
add_filter( 'script_loader_tag', function ( $tag, $handle ) {     if ( 'addthis_widget.js' !== $handle )         return $tag;     $tagstring = str_replace( 'text/javascript', 'text/plain', $tag );     $tagstring = str_replace( ' src', ' data-cookieconsent="marketing" src', $tagstring );     return $tagstring; }, 10, 2 );

Showing your cookie declaration in full on a separate WordPress page or post:

If you want to show your cookie declaration in full on a seperate page or as part of your privacy policy, embed your cookie declaration script as described below. In the content editor for the page or post where you want to show your cookie declaration in full, switch to text view mode and paste the script code where you want the declaration to show, e.g.:

<script id="CookiePolicy" src="https://consent.cookiebot.com/00000000-0000-0000-0000-000000000000/cd.js" type="text/javascript" async></script>

30 day free trial Cookiebot

Cookie scanner, cookie banner, cookie declaration en cookie consent in one solution.

  • Use cookies on your website compliant with GDPR, ePrivacy and cookie legislation
  • Cookie management completely automated
  • Cookie banner based on your corporate identity
  • Automatic composed cookie declaration, always up to date

The Cookiebot solution runs on 500,000+ websites, manages 13 billion User Consents and supports 40+ languages.