Adding functionalities in functions.php

Get compliant today in the European Union, United States, Canada, United Kingdom, Australia, Brazil & South Africa with the only Privacy Suite for WordPress that offers a fully-featured plugin for Worldwide Compliance.

A quick introduction

WordPress offers filter hooks to allow plugins to modify various types of internal data at runtime.

A plugin can modify data by binding a callback to a filter hook. When the filter is later applied, each bound callback is run in order of priority, and given the opportunity to modify a value by returning a new value.

The following example shows how a callback function is bound to a filter hook.

Note that $example is passed to the callback, (maybe) modified, then returned:

If you want to know more, before adding your first add_filter(), see the below source. If it’s your first time, see our collection of filters below.


If you have never used add_filter() or other functions to modify .php files in your theme or plugin files. Please make sure you have a back-up of the file you’re modifying and quick access to your FTP to revert back if anything goes wrong.

Adding your filters with Must-Use Plugins. It’s really simple!

Adding filters and hooks for our plugin might look difficult, but it can be done quite easily. Copy/Paste the needed snippet below in your favourite text editor and follow the instructions in our article about MU Plugins.

When implementing the filters below in functions.php, make sure to remove the first <?php line. When using MU Plugins, this line can be left in place.

Our collection of prefilled add_filter

Recent articles

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


Popular articles

Join our mailing list - 8 Tips & Tricks in your inbox over the next 8 weeks!