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
- Navigate to the page or post where you want to hide the cookie banner.
- Make sure you open the settings tab, using the button on the top-right of your screen.
- Find the Cookiebanner tab and click ‘Disable Complianz on this page’.
- Update the page to save your changes.
Exclude pages or posts using the Classic editor
- Navigate to the page or post where you want to hide the cookie banner.
- Find the Cookiebanner meta box and click ‘Disable Complianz on this page’.
- 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: