The Privacy Suite for WordPress

Adding filters with MU Plugins. Quick & Easy

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. Check out this Manual with Example!
  2. Find the required code in our hooks and filters overview
  3. Open your favorite text editor, start the file with
  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

The Privacy Suite for WordPress
Get compliant today with the only Privacy Suite made for WordPress

Categories

Popular articles

Subscribe