Table of Contents

I'm excited to announce the release of AkuraiGeo 2.0.0, a major update that brings more flexibility to how you can implement geo-targeting on your WordPress site. The biggest change? You're no longer required to use Cloudflare for country detection!

What's New in 2.0.0?

This update introduces two powerful new ways to handle geo-detection:

  • Custom HTTP Header Support
  • Custom Country Detection Function

Let's dive into how you can use these new features.

Using Your Own HTTP Header

If your hosting provider or infrastructure already includes country information in a custom HTTP header, you can now easily configure AkuraiGeo to use it. Simply add this snippet to your child theme's functions.php:

add_filter('akurai_geo_header_name', fn () => 'YOUR-CUSTOM-HEADER-NAME');

For example, if your server provides country codes in a header called X-Country-Code:

add_filter('akurai_geo_header_name', fn () => 'X-Country-Code');

Implementing Custom Geo-Detection

For more advanced use cases, you can now implement your own geo-detection logic entirely. This is perfect if you're using a third-party geo-location service or have your own detection mechanism. Here's how to do it:

add_filter('akurai_geo_country_code', function() {
    // Your custom geo-detection logic here
    // For example, using a hypothetical GeoService:
    $geoService = new GeoService();
    $countryCode = $geoService->detectCountry();
    
    // Must return an ISO 3166-1 alpha-2 country code (e.g., 'US', 'GB', 'DE')
    return $countryCode;
});

Why This Matters

Previously, AkuraiGeo required Cloudflare to function, which meant you needed to route your website traffic through Cloudflare's services. While Cloudflare is excellent, I understand that not everyone uses it or wants to use it. Version 2.0.0 removes this limitation, allowing you to:

  • Use alternative CDN providers
  • Implement your own geo-detection logic
  • Integrate with existing geo-location services
  • Maintain full control over your infrastructure

Important Notes

  • Both methods must return an ISO 3166-1 alpha-2 two-letter country code
  • The update is fully backward compatible - if you're happy with Cloudflare, no changes are needed
  • Existing geo-targeting blocks and settings will continue to work as before

Getting Started

To upgrade to AkuraiGeo 2.0.0, simply update the plugin through your WordPress dashboard. If you're new to AkuraiGeo, you can purchase it on plugin's main page For detailed implementation guidelines, check out our updated documentation.