IP geolocation
Also known as: IP-based geolocation, geo-IP detection
IP geolocation is the technique of inferring a visitor's geographic location from their IP address — typically country, region, and sometimes city. Used in international SEO contexts to make routing decisions (which language version to show), serve regional pricing, or detect geographic intent. For SEO specifically, IP geolocation is the WRONG way to route between hreflang language versions — Google explicitly warns against it.
How IP geolocation works
A visitor’s IP address is looked up against a database mapping IP ranges to geographic regions:
- Country level — typically accurate to 95%+
- Region/state level — 80-90% accurate
- City level — 60-80% accurate
- Lower (postal code, street) — usually unreliable
Major providers: MaxMind, IPinfo, ip2location. CDN providers (Cloudflare, Fastly) often expose IP geolocation as a header.
Why IP geolocation is wrong for hreflang routing
Google explicitly warns against automatic IP-based redirects between language versions:
“Some pages get redirected based on the user’s perceived country, which can be frustrating if you want to access a site that’s localized for a different region.”
The problems:
- Googlebot crawls from US IPs — your en-US page is what it sees, even if you’ve configured fr-FR for French users
- VPN users show wrong location, hitting wrong content
- Travelers get unwanted regional content
- Browser language preference is more reliable — a user has explicit preferences
Google’s recommended approach for hreflang routing:
- Let users land on the URL they requested
- Show a banner (“It looks like you’re in France. Visit the French version?”)
- Respect their click; remember choice in a cookie
Legitimate uses of IP geolocation in SEO
Not all IP geolocation is bad:
- Showing regional pricing in an unobtrusive overlay (without redirecting)
- Server-side rendering of currency in product listings
- Default selection in a region picker (still user-overridable)
- Geographic analytics (knowing where visitors come from for reporting)
The distinction: enriching the experience with location-aware DEFAULTS is fine; HARD redirecting based on IP is not.
How to implement region routing correctly
Best practice for an international site:
- Initial visit: serve the requested URL (no redirect)
- Detect locale via IP or browser language
- Show suggestion banner if the detected locale doesn’t match the URL
- User clicks to switch (or dismisses to stay)
- Cookie remembers their choice for next visit
This pattern respects user intent, works for crawlers, and provides good UX.
Resocial perspective
IP-based automatic redirects between language versions is the most common international SEO anti-pattern we audit out. The fix isn’t “stop using IP geolocation” — it’s “use it for SUGGESTIONS, not REDIRECTS.” See our International SEO services for the routing playbook that survives Google’s crawling and serves users well.
- Resocial service →
/services/international-seo/ - Read on the blog →
/blog/hreflang-vs-canonical/