WordPress Plugin
The plugin will automatically detect the language of your site, but it only works with one language by default. If you need more than one language, please see the section on the WordPress Multilanguage Plugin (WPML below). You will need to use both of them.
The plugin will automatically find and block Youtube. Still, the rest has to be blocked using the cookie control SDK as per usual.
Only enable TCF if you are also utilising the TCF template in the pop-up section of the consent solution. If you are not using the TCF template, this will render the pop-up useless.
Pop-up implementation
If you do not want to use the WordPress plugin and prefer implementing the consent pop-up in the code, follow the below guide:
Open the dashboard on your WordPress website.
Go to Appearance - Editor in the left-hand menu.
Locate header.php. This header can have various names depending on the template but will always display (header.php) underneath.
This place is the HTML of your <head> on all your pages. The consent pop-up script should be implemented here to display it on all the pages.
Insert the CookieConsent script between the opening and closing <head> tag.
<script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="EN" type="text/javascript"></script>
Save the change by pressing “Update File” at the bottom of the page.
Example:
A multi-language site using WPML
If you are using the plugin: WPML to change the language on your website, you need to grab the lang-code from the plugin to combine it without data-culture in the consent pop-up script. The script will then look like this:
<script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="<?php echo ICL_LANGUAGE_CODE; ?>" type="text/javascript"></script>
Cookie policy implementation
To show the cookie policy, you have to create a new page or navigate to an existing page where you want the privacy widgets to be displayed. Insert our cookie policy or privacy control script in the content (see below).
The cookie policy script:
<div><script type="text/javascript" id="CookiePolicy" src="https://policy.app.cookieinformation.com/cid.js" data-culture="EN"></script></div>
Remember to edit the data-culture to change the language.
The privacy controls script:
<div><div id="cicc-template"></div></div>
For the cookie policy and the privacy controls widget to work properly in WordPress, you must insert them into an extra <div>, as shown above.
Related articles: