Overriding the GEO IP header

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.

Complianz contains GEO IP functionality to display the ‘correct’ type of Cookie Banner, either opt-in or opt-out, based on the region from which a visitor reaches your website.

If your site is behind a DDoS protection service such as CloudFlare, that service will be forwarding the traffic to your site. This means that the requests are received from that protection service, and the IP address would be stored in a different ‘header’.

Complianz’ GEO IP implementation will check the following header values (from top to bottom), and if the one being checked either does not exist or equals ‘’, it moves on to the next one:

  • ‘CF-IPCountry’,

You can override the header that Complianz checks with the below filter, in case your set-up requires this:

Change HTTP_FORWARDED_FOR on line 3 to the header that Complianz should check for the IP address.

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!