Complianz Privacy Suite

Adding filters with MU Plugins. Quick & Easy

Aert Hulsebos

Aert Hulsebos


Popular articles

Generating an Impressum

From release 4.4 onwards, Complianz Privacy Suite (Premium) offers a new document, the Impressum. The Impressum provides the required information for commercial websites that target

Read More
Share on facebook
Share on twitter
Share on linkedin

You might want to change your Cookie Banner Read more URL or have your placeholders when using Complianz. To edit some features of Complianz, you will need to apply some extra code to your WordPress installation. Below we will explain how you can use so-called Must-Use plugins to apply these filters.

Do you want to know which functionalities you can add to Complianz? Visit our overview of the features and code snippets.

How to implement filters with Must-Use plugins.

Must-Use plugins, in short, is a folder in WP-Content called ‘mu-plugins’ which is a collection of files which are activated by default and cannot be deactivated in your WordPress dashboard. These files will stay put and activated even if you’re updating your WordPress installation or theme.

If you don’t have a mu-plugins folder in wp-content, you can simply open your FTP client, then add the folder under the wp-content directory. The result should look like */wp-content/mu-plugins/

To add a filter described in our hooks and filters overview you can copy/paste the code to your favorite text editor and change the variables as described in the code. 

For example:

Do you want to unset a service from the Cookie Blocker so it will load before consent? You should copy/paste the below code in your text editor and change my-blocked-script-tag.js to the social marker you would like to unset.

function cmplz_edit_script_tags($script_tags){
if (($key = array_search(‘my-blocked-script-tag.js’,
$script_tags)) !== false) {
return $script_tags;
add_filter(‘cmplz_known_script_tags’, ‘cmplz_edit_script_tags’);

How to find you marker?

For Chrome:

Right click
Click Inspect
Find “Sources” in the top navigation.
Search for the URL corresponding to your service on the left hand side under “Page”.
Find the URL in our list markers, see below for markers by category.
Use the URL to unset this specific service.

Saving your new filter and uploading it with FTP

  1. After editing the filter, save your file ending with .php. For example unsetservice.php
  2. Upload unsetservice.php to wp-content/mu-plugins/ via FTP
  3. Check if the service will be set before consent.


Below you can find an example of the code you need if you want to prevent Complianz from blocking Dailymotion. The string as listed above is inserted in the code, then this code is placed in a mu-plugin.

Not sure what to add in the variables? Ask support, we are happy to help!

function cmplz_edit_script_tags($script_tags){
if (($key = array_search(‘’,
$script_tags)) !== false) {
return $script_tags;
add_filter(‘cmplz_known_script_tags’, ‘cmplz_edit_script_tags’);

Related articles

Leave a Reply

Your email address will not be published.