Country Code and Cloudflare
-
In the get_country() function, you should consider looking for the existence of header “CF-IPCountry” and using that as a lot of WordPress sites go through Cloudflare (a free CDN which speeds up WordPress site by offloading transactions to the CDN) as they are already doing a geo lookup and actively maintain it (for v4 and v6).
Here is their documentation on it https://support.cloudflare.com/hc/en-us/articles/200168236-What-does-Cloudflare-IP-Geolocation-do-
- The topic ‘Country Code and Cloudflare’ is closed to new replies.