Description
Country Blocker is the easiest way to block website visitors by country, region, or IP address. No API keys required, no complicated setup – just activate, select countries to block, and protect your site instantly.
Perfect for compliance, security, and content licensing:
- GDPR compliance – Block EU countries to avoid cookie consent requirements
- CCPA compliance – Block California traffic if you can’t meet data privacy requirements
- Gambling & gaming sites – Restrict access from prohibited jurisdictions
- Streaming & licensed content – Enforce geographic licensing restrictions
- Financial services – Block countries you’re not licensed to operate in
- Reduce spam & attacks – Block high-risk countries and VPN traffic
Why Choose Country Blocker?
✅ One-click setup – No API keys or database downloads to start blocking
✅ Actually works – Automatic failover across 4 geolocation providers ensures reliability
✅ VPN & proxy detection – Optional blocking of VPNs, proxies, data centers, and hosting providers
✅ SEO friendly – Automatically allows Google, Bing, and other search engine crawlers
✅ Won’t lock you out – WordPress admin and login pages always remain accessible
✅ Privacy focused – Minimal data storage with IP hashing for security
Key Features
Blocking & Access Control:
* Block visitors from any country with a simple checkbox (250+ countries)
* Optional VPN, proxy, and datacenter detection and blocking
* Search engine crawler bypass (Google, Bing, DuckDuckGo, etc.)
* Choose to allow or block visitors when country cannot be determined
* Emergency bypass URL parameter for troubleshooting
* WordPress admin and login pages are never blocked
Geolocation & Accuracy:
* Works instantly without API keys
* Automatic failover across 4 free geolocation APIs
* Optional MaxMind GeoLite2 database support (requires free license key)
* Cloudflare IP detection support
* Supports proxy headers (X-Forwarded-For, X-Real-IP, CF-Connecting-IP)
Logging & Monitoring:
* Track all blocked and allowed access attempts
* View visitor country codes and decision reasons
* Automatic log cleanup (configurable retention period)
* Rate limiting to prevent log spam
Privacy & Security:
* IP addresses are hashed by default for privacy
* GDPR and CCPA friendly minimal data storage
* Configurable data retention policies
* No tracking scripts or external cookies
Pro Version
Need more granular control? Country Blocker Pro includes:
Region-Level Blocking:
* 🇺🇸 Block specific US states (all 50 states + DC, Puerto Rico, Guam, US Virgin Islands)
* 🇨🇦 Block Canadian provinces and territories
* 🇬🇧 Block UK regions (England, Scotland, Wales, Northern Ireland)
* 🇦🇺 Block Australian states and territories
* 🇩🇪 Block German states (Bundesländer)
* 🇮🇳 Block Indian states and union territories
* 🇨🇳 Block Chinese provinces and municipalities
* 🌍 Block entire continents with one click
Advanced Features:
* IP whitelist – Never block specific IPs (supports CIDR notation)
* IP blacklist – Always block specific IPs regardless of location
* Custom block page with full color customization
* Custom CSS editor for complete design control
* Redirect blocked visitors to any URL
* Advanced logging with CSV export
* Smart log retention and database optimization
* Priority email support
External Services
This plugin connects to external services for geolocation functionality and optional feedback collection. By using this plugin, you acknowledge that data will be sent to these third-party services.
1. IP Geolocation Services
To determine a visitor’s country, the plugin sends the visitor’s IP address to one or more of the following geolocation providers (in failover order):
ipwhois.is
* Service: IP geolocation lookup
* Data sent: Visitor IP address
* When: On each unique visitor’s first page load (cached for 24 hours)
* Terms of Service: https://ipwhois.io/terms
* Privacy Policy: https://ipwhois.io/privacy
ip-api.com
* Service: IP geolocation lookup (fallback provider)
* Data sent: Visitor IP address
* When: If ipwhois.is fails
* Terms of Service: https://ip-api.com/docs/legal
* Privacy Policy: https://ip-api.com/privacy
ipapi.co
* Service: IP geolocation lookup (fallback provider)
* Data sent: Visitor IP address
* When: If previous providers fail
* Terms of Service: https://ipapi.co/terms/
* Privacy Policy: https://ipapi.co/privacy/
ipinfo.io
* Service: IP geolocation lookup (fallback provider)
* Data sent: Visitor IP address
* When: If previous providers fail
* Terms of Service: https://ipinfo.io/terms-of-service
* Privacy Policy: https://ipinfo.io/privacy-policy
2. Deactivation Feedback Service
When you deactivate the plugin, you have the option to submit feedback about why you’re deactivating. This is completely optional.
Simple tools for wp Feedback API
* Service: Plugin deactivation feedback collection
* Data sent (only if you submit feedback): Plugin slug, your site URL, deactivation reason, optional text feedback, WordPress version, PHP version, plugin version
* When: Only when you voluntarily submit the deactivation survey form
* Endpoint: https://plugins-for-wp.com/wp-json/ssp-feedback/v1/submit
* Privacy: No personal data or visitor information is collected. Only technical site information and your voluntary feedback are sent.
* Purpose: To help us improve the plugin based on user feedback
3. Optional: MaxMind GeoLite2 Database
If you provide a MaxMind license key in settings, the plugin will download the GeoLite2 database to your server for local geolocation lookups, reducing external API calls.
MaxMind GeoLite2
* Service: Geolocation database download
* Data sent: Your MaxMind license key
* When: Once per week when you configure a license key
* Downloaded to: wp-content/uploads/GeoLite2-City.mmdb
* Terms: https://www.maxmind.com/en/geolite2/eula
* Privacy: https://www.maxmind.com/en/privacy-policy
Data Retention:
The plugin stores minimal data on your WordPress database: hashed IP addresses (for rate limiting), country codes, access decisions (blocked/allowed), and timestamps. You can configure automatic log cleanup in settings. The plugin does not track individual visitors or create profiles.
Privacy & Data Usage
This plugin is designed with privacy in mind:
- IP addresses are hashed by default before storage
- Only country codes and access decisions are logged, not full visitor profiles
- Logs can be automatically cleaned up after a configurable retention period
- No cookies are set on the visitor’s browser
- No tracking scripts are loaded
- Geolocation lookups are cached to minimize external API calls
- Deactivation feedback is completely optional and only submitted if you choose to provide it
For GDPR compliance, the plugin blocks visitors from specified countries, which may reduce your data collection obligations. However, you should still review your complete privacy obligations with a legal professional.
Installation
- Upload the plugin folder to
/wp-content/plugins/or install via Plugins Add New Upload - Activate Country Blocker
- Go to Geoblocker Lite in your admin menu
- Select countries to block and save settings
- Visitors from blocked countries will immediately see a 403 restriction page
FAQ
-
Does this work without an API key?
-
Yes! The plugin works immediately after activation without any API keys. It automatically uses free geolocation APIs with intelligent failover.
-
Will this block search engines like Google?
-
No. The plugin automatically detects and allows search engine crawlers to ensure your SEO is not affected.
-
Does it store visitor data?
-
The free version stores minimal data. IP addresses are hashed by default for privacy. Basic log entries show country codes and access decisions. You can configure automatic log cleanup.
-
What data is sent to external services?
-
The visitor’s IP address is sent to geolocation APIs to determine their country. If you voluntarily submit the deactivation feedback form, technical site information and your feedback are sent to our feedback API. See the “External Services” section for complete details.
-
Will it work with Cloudflare?
-
Yes. The plugin automatically detects and uses proxy headers like
HTTP_CF_CONNECTING_IPto get the real visitor IP address. -
What if I accidentally block myself?
-
The WordPress admin login page (
/wp-admin) is never blocked. Access your site atyoursite.com/wp-adminand log in normally. -
Can I block specific US states?
-
State and province-level blocking is available in Country Blocker Pro for the United States, Canada, United Kingdom, Australia, Germany, India, and China.
-
Can I block VPN users?
-
Yes. Enable the “Block VPNs & Data Centers” option in settings to block known VPN services and hosting providers.
-
How accurate is the geolocation?
-
Country-level accuracy is typically 95%+ for most regions. You can optionally add MaxMind GeoLite2 database support for improved accuracy.
-
Is the deactivation feedback required?
-
No. The deactivation feedback is completely optional. You can skip it and deactivate immediately, or you can cancel and keep the plugin active.
Reviews
Contributors & Developers
“Country Blocker and Geoblocker FREE” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Country Blocker and Geoblocker FREE” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.8 – 2025-02-18
- Plugin improvements and optimizations
- Bug fixes and stability enhancements
1.0.7 – 2025-01-28
- Rebranded plugin
- Updated all URLs and links
- Removed old branding references
1.0.6 – 2025-01-28
- Updated branding and URLs
- Updated support links
- Minor improvements
1.0.5 – 2025-01-16
- Added country search functionality
- Fixed politically sensitive terminology
- Updated coupon messaging
- Improved plugin descriptions
- Performance optimizations
1.0.3
- Minor updates and improvements
- Performance optimizations
1.0.2
- Initial WordPress.org release
- Country-level geoblocking
- Basic logging system
- MaxMind GeoLite2 support
- VPN/datacenter detection
1.0.1
- Internal testing release
1.0.0
- Initial release
