How to Manually Integrate a CMP Script on a WordPress Site
Summary
This guide provides step-by-step instructions on how to manually integrate Improve Digital Yield's Consent Management Platform (CMP) script on a WordPress website using the theme editor. This method is an alternative to using a plugin and ensures compliance with data protection regulations by displaying a consent banner on your site.
Introduction
To comply with the General Data Protection Regulation (GDPR), it's essential to display a consent banner on your website, especially if you have international traffic. While a WordPress plugin can automatically handle this, another effective method is to manually add the CMP script directly into your site's source code. The most universal way to do this is by using the WordPress theme editor.
Step-by-Step Guide
Step 1: Access the WordPress Theme File Editor
Log in to your WordPress dashboard.
On the sidebar, click on the "Appearance" tab.

In the drop-down menu that appears, click on "Theme File Editor".
This will give you access to the various files that make up your site's theme, including the header.php file, which is where you will place the CMP script.
This will give you access to the various files that make up your site's theme, including the header.php file, which is where you will place the CMP script.


Step 2: Locate and Copy the CMP Script
Go to your Improve Digital Yield dashboard.
Navigate to the "Consent Banner" section.
Here, you will find the CMP script you need to copy.
The script is a piece of code that will display the consent banner on your site.
Step 3: Paste the CMP Script into the header.php File
Return to the WordPress Theme File Editor.
On the right-hand side, under "Theme Files," find and click on the header.php file.
Locate the <head> section in the code.
Paste the CMP script you copied in the previous step between the <head> and </head> tags.
Click the "Update File" button to save your changes.
Step 4: Clear Your Cache
Once you have saved the file, remember to clear your site's cache. This ensures the changes take effect and the CMP banner is displayed correctly on your site.
Alternative Method
While using the Theme File Editor is a reliable method, you can also integrate the CMP manually using a "Code Snippet" plugin. This is a viable solution if you are familiar with these types of plugins.
Related Articles
What is a CMP / Consent Banner? FAQ
Summary A CMP (Consent Management Platform), often seen as a "consent banner," is an essential tool for any publisher who wishes to comply with data privacy laws like the GDPR. It allows you to legally collect and manage your visitors' consent for ...
Guide for CMP Integration and GDPR Compliance
Summary This article explains how to integrate the InMobi CMP consent banner on your website. Learn where to find the necessary code, how to implement it, and how to verify that the integration is working correctly. Introduction To comply with the ...
What is a CMP / Consent Banner?
Summary A CMP (Consent Management Platform), often seen as a "consent banner," is an essential tool for any publisher who wishes to comply with data privacy laws like the GDPR. It allows you to legally collect and manage your visitors' consent for ...
Why Doesn't the Consent Banner Work on My Blogger Site?
Summary Our standard consent banner (CMP) script may not work correctly on a Blogger (Blogspot) site due to the unique way Blogger's platform handles HTML and third-party scripts. To resolve this, we provide a special version of the CMP code ...
How to Manually Integrate ads.txt on WordPress (Without FTP)
Procedure for Manual ads.txt Integration on WordPress (Without FTP Access) If you are unable to integrate the ads.txt file using our official plugin (for instance, if your site operates on an Nginx server) or if you have simply not installed our ...