Home > Docs > GDPR Cookie Consent > Geo-target Cookie Message Bar for Countries other than EU using GDPR Cookie Consent plugin

Geo-target Cookie Message Bar for Countries other than EU using GDPR Cookie Consent plugin

Last updated on December 21, 2021

Using the GDPR Cookie Consent plugin by WebToffee, you can make the cookie notice bar appear only to visitors of EU countries. But, if you need to display the cookies bar to countries other than the EU, the following code snippet allows you to do that.

From the WordPress dashboard, go to GDPR cookie consent > Settings > General. Then, enable the geo IP feature from the GDPR settings section as shown in the screenshot below:

After enabling the geo IP feature from the settings page, add the below code snippet with the corresponding country code in the array_push() function.

The code snippet below allows you to display the cookie message bar in Canada. Simply copy the code snippet to the active child theme’s functions.php file to achieve this.