Hide the Cookie Banner on certain pages

Some use cases might be better off by excluding the cookie banner on certain pages. These use cases should be considered individually. With update 4.7.1 we added a setting using a meta-box, which makes it very simple to disable the cookie banner on a certain page. If you want to exclude a larger number of pages, you can use a WordPress filter instead, which we will explain below as well.

Exclude pages or posts using the Gutenberg editor

  1. Navigate to the page or post where you want to hide the cookie banner.
  2. Make sure you open the settings tab, using the button on the top-right of your screen.
  3. Find the Cookiebanner tab and click ‘Disable Complianz on this page’.
  4. Update the page to save your changes.

Exclude pages or posts using the Classic editor

  1. Navigate to the page or post where you want to hide the cookie banner.
  2. Find the Cookiebanner meta box and click ‘Disable Complianz on this page’.
  3. Update the page to save your changes.

The Filter – Exclude a single page

You can exclude the banner by using a filter in your functions.php, but we would suggest using an MU Plugin.

Excluding multiple pages

Needless to say, it might not be a good idea to exclude the cookie banner from multiple pages from a compliance perspective. Though if this is desirable in your situation, you can filter on post ID’s.

Finding the postID which corresponds to your page, post any custom post type.

When editing a page or post, you will find the postID in the domain field of your browser. In this case, I’m editing this post with the following URL in my domain field:

https://domain.com/wp-admin/post.php?post=241441&action=edit

In this case, my postID = 241441

For multiple postID’s the filter will look like this:

Join 1M+ users and install The Privacy Suite for WordPress locally, automated or fully customized, and access our awesome support if you need any help!

Complianz has received its Google CMP Certification to conform to requirements for publishers using Google advertising products.