Adding filters with MU Plugins. Quick & Easy

More functionalities for Complianz



Junior Developer & Support


Most Popular Articles

Subscribe to our newsletter

    For EU Subscribers | Privacy Statement
    For USA Subcribers | Privacy Statement

  • This field is for validation purposes and should be left unchanged.

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:

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

Social Markers | Google Services
new google.maps.
new GMW_Map
google_ad_client //google adsense
pagead/js/adsbygoogle.js //google adsense //google adsense //google adsense

Social Markers | LinkedIn

NB. This is an async script tag and needs another filter.

Social Markers | Twitter


Social Markers | Facebook

Social Markers | Pinterest

Social Markers | Instagram


Social Markers | Disqus

Social Markers | Other
super-socializer //super socializer
theChampFBKey //super socializer

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');
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published.

© Copyright - Complianz 2019

Complianz Privacy Suite 3.1 is live!

See our new features and available documentation. Read more