Complianz Privacy Suite

Adding filters with MU Plugins. Quick & Easy

Aert Hulsebos

Aert Hulsebos


Popular articles

Creating the Legal Hub

Have you seen our new Legal Hub? If not, have a look before reading this instruction article. We created the legal hub to centralize our

Read More

Placeholders for iFrames

From 4.6.11 onwards, you can also use consent shortcode wrappers. An instruction can be found here. You’re able to block iFrames with Complianz with the

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.

What are mu-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. Filters can also be implemented in your functions.php, but this would mean that your theme can not be updated anymore, unless using a child-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/

How to implement filters with Must-Use plugins.

  1. Find the required code in our hooks and filters overview
  2. Open your favorite text editor, start the file with <?php  
  3. Copy and paste the code and change the variables as described in our article. 
  4. After editing the filter, save your file ending with .php. For example myfilter.php Tip: use a descriptive file name so you can remember the function of a particular mu-plugin.
  5. Upload myfilter.php to wp-content/mu-plugins/ via FTP
  6. Check your site if the plugin has the desired functionality. For some filters it might be neccesary to clear your cache and test in a private/incognito browser window when testing. If any errors appear, you can simply delete the file from the mu-plugins folder.

 That’s it!

Recent articles