Overview
Geo Blocking lets you control which countries can access your WordPress site. Each visit is geolocated by IP using an up-to-date GeoIP database. Depending on your configuration, you can block (Blacklist) or allow (Whitelist) specific countries.
While Attack Protection blocks attack vectors (SQLi, XSS, LFI) and other rules block malicious IPs, Geo Blocking filters by geographic nationality — regardless of whether the IP has a clean record.
What makes it unique
- Filters by country, not by individual IP
- Ideal for sites with a known regional audience
- Complements other protections without replacing them
When to use it
- Regional site that only operates in certain countries
- Mass attacks from specific regions
- Regulatory compliance (GDPR, local data protection)
geo_blocking
Strategy: Blacklist vs Whitelist
The first decision is to choose between two mutually exclusive strategies. The one you pick determines how each visit is evaluated.
Blacklist (Recommended)
Blocks only the countries you select. The rest of the world can access normally.
✅ Ideal for:
- Global sites that want to block high-risk regions
- Lower risk of blocking legitimate visitors
Whitelist
Only allows the countries you select. Everything else is blocked.
✅ Ideal for:
- Sites with a 100% regional audience (e.g., Spain only)
- Maximum geographic security
Action Modes
Once the strategy is defined, the mode determines how visits that fall within the rules are handled.
📊 Log only
Does not block anything. Logs every visit that would be blocked according to your strategy. It is the option recommended initially, to calibrate your configuration without risk.
🧮 Math Challenge
Shows a page with a simple sum (e.g. 4 + 7 = ?) the visitor must solve to continue. The page responds with HTTP status 429. If they answer correctly, they are let through for 1 hour without being challenged again. If they fail, they can retry.
🚫 Direct Block
Blocks with an "access denied" page (403 Forbidden). No verification or second chance. Only use it once you are sure of your configuration, after validating in "Log only" and "Math Challenge".
🔒 Minimal Block
Just as restrictive as Direct Block (403), but without the branded page: shows only the plain text 403 Forbidden - Geo-Blocking. Useful if you'd rather not show your branding or any detail to blocked traffic.
Country Selection
The country selector includes approximately 80 countries with real-time search and multi-selection. You can type to filter or check/uncheck manually.
High-risk country shortcut
The "+ High risk" button automatically marks these five countries with reported high malicious activity:
geo_blocking.countries — Contextual help key for the country selector.
Application Contexts
Geo Blocking can be applied to different parts of the site. Choosing the right context is key to avoiding false blocks in public areas.
🔒 wp-admin Recommended
Applies geo-blocking only to the admin panel. Front-end visitors are not affected. Ideal for protecting admin access without impacting the public experience.
🔑 Login / Registration Recommended
Protects the login, registration, and password recovery pages. Stops account creation and brute-force attacks from unwanted countries.
📮 POST Requests
Applies the filter only to POST requests (form submissions, comments, purchases). GET requests are not evaluated. Useful for stopping form spam without affecting navigation.
🌐 All traffic Risky
Applies geo-blocking to all requests, including front-end, APIs, REST, cron, etc. Not recommended except in very specific cases (intranet, sites with 100% local audience).
Exception paths
You can define paths that are excluded from geo-blocking. Useful for public APIs, webhooks, or pages that must be globally accessible. Supports wildcards (*).
Logging & Monitoring
Each Geo Blocking event is recorded in the firewall log with the following information:
📋 Logged information
- Visitor IP
- Detected country
- Context (wp-admin, login, POST, all)
- Requested URL
- Action taken (Monitor, Challenge, Block)
📊 How to use the logs
- Enable Monitor and wait 48 hours
- Review which countries appear most in the logs
- Adjust your country selection if you see legitimate activity being blocked
- Move to Challenge when satisfied
Limitations
Geo Blocking is a powerful tool, but it has important limitations you should know before implementing it.
🌍 IP-based geolocation
Geolocation is based on GeoIP databases that map IP addresses to countries. It is not 100% accurate. An IP may appear in a neighboring country, change ownership, or be misclassified. Typical accuracy is 95-99% for countries, but may be lower for mobile IPs or multinational companies.
🔓 VPN / Proxy Evasion
Any visitor using a VPN, proxy, or the Tor network can spoof their country of origin. Geo Blocking does not automatically detect or block VPNs. An attacker in a blocked country can choose a VPN server in an allowed country and evade the restriction. This is the most important limitation of geo-blocking.
📡 GeoIP database
The plugin uses a local GeoIP database that is updated periodically. If the database is outdated, some countries may be misclassified or new IPs may be missing. Automatic updates occur once a month, but depend on the server's connectivity to seensecure.com.
📱 Shared IPs / CDN
Visitors behind a CDN (Cloudflare, Akamai) or with shared IPs (mobile carriers, NAT) may show the CDN or gateway country, not their real location. If you use Cloudflare, the plugin detects the CF-IPCountry header for better accuracy.