Works with your stack
Cookie consent on WP Engine
GeoTarget
WP Engine gives the visitor’s country to PHP through its GeoTarget feature. Cookie Rocks Pro can read it for rules by country.
By WP Engine · wpengine.com
Is this your product? Tell us if anything here is out of date. Write to us
What matters for consent with WP Engine
GeoTarget is a paid feature
GeoTarget comes with Premium plans and is bought separately on the others. WP Engine support turns it on for each environment.
Read through getenv()
PHP reads the country with getenv('HTTP_GEOIP_COUNTRY_CODE') and the region with getenv('HTTP_GEOIP_REGION'). The region has two letters in the United States and Canada, and is a number elsewhere.
The platform sets the value
The WP Engine GeoTarget plugin only reads these values. Because the name starts with HTTP_, a request header with the same name can show up in it on Apache when the request does not go through WP Engine.
What our tests found on WP Engine
Good to know · Cookie RocksWP Engine country is checked like a CDN header
With the WP Engine source, rules by country use HTTP_GEOIP_COUNTRY_CODE only after the spoof check (Verify now, repeated every day): the site sends itself GEOIP-Country-Code: ZZ, and the source is trusted only if another value comes back.
Seen in our tests, 25 October 2026, Cookie Rocks.
Good to know · WP Engine GeoTargetWP Engine's country variable is read outside the page cache
NitroPack reads getenv('HTTP_GEOIP_COUNTRY_CODE') at the very start of each PHP request on WP Engine, GeoTargetingWP reads it in its admin-ajax mode, and the WP Engine GeoTarget plugin checks it in wp-admin: the value reaches PHP requests that bypass the page cache.
Read in its code, 25 October 2026, WP Engine GeoTarget.
Good to know · WP Engine GeoTargetWP Engine GeoTarget is paid, and its variable has a header name
GeoTarget comes with Premium plans and is bought separately on Lite, Startup, Growth and Scale; WP Engine support then turns on a cache bucket (continent, country, state or region, city) for each environment. PHP reads getenv('HTTP_GEOIP_COUNTRY_CODE') and getenv('HTTP_GEOIP_REGION') (two letters in the US and Canada, a number elsewhere). Only the platform sets these values: the WP Engine GeoTarget plugin reads them and does not create them. Edge Full Page Cache must be off. Because the name has the HTTP_ prefix, on Apache with mod_php a visitor's GeoIP-Country-Code request header also shows up in getenv('HTTP_GEOIP_COUNTRY_CODE') (tested on 25/10/2026 in a php8.3-apache container).
Read in its code, 25 October 2026, WP Engine GeoTarget 1.2.9. Source
Hosting and CDN
Other plugins of the same kind.
Questions
What happens after the 30-day trial?
The banner, your visitors’ choices and your proofs of consent keep working. Without a key, most settings lock, updates and support stop. Take a key at any time and everything opens again.
For sites on WP Engine
The right rules for each visitor’s country.
country by country
Rules by country are part of the complete plugin. Every feature of the complete plugin for 30 days, no card.
- During the trial: everything, including the full settings and the scans
- After 30 days without a key: the banner, your visitors’ choices and your proofs of consent keep working
- What waits for a key: most settings, updates and support

Get your trial key
Your e-mail and your site. Your key arrives as soon as you confirm your e-mail.