Country Block – Ultimate Geo-Blocker, IP Ban & Login Security

Plugin Banner

Country Block – Ultimate Geo-Blocker, IP Ban & Login Security

by vpndeals

Download
Description

Country Block provides an exceptionally user-friendly, powerful, and modern IP geolocation blocking experience for WordPress. Our mission is to offer incredible value for free, helping you secure your website and control access with precision and ease.

Whether you want to block traffic from specific countries to reduce spam and malicious activity, or ensure your content is only accessible to visitors from designated regions, Country Block offers a flexible and robust solution.

Core Features:

  • Effortless Country Blocking: Easily block or allow access from multiple countries or pre-defined groups like the European Union.
  • Visitor IP Detection: Uses the connection IP by default. A trusted proxy header can be selected for Cloudflare, Varnish, or Nginx when the host securely configures that header and protects direct origin access.
  • Express Onboarding Setup: A guided wizard gets you up and running in minutes upon activation.
  • Modern “2030 Era” UI: Enjoy an intuitive, clean, and responsive admin interface that’s a pleasure to use.
  • Flexible Geolocation Source:
    • Free Local Database (GeoLite2 by MaxMind): High-performance, reliable country-level blocking using a local MaxMind GeoLite2 database, updated automatically every day to ensure maximum accuracy. Requires a free MaxMind account for database updates.
  • Whitelisting: Exempt specific IP addresses/CIDR ranges, user roles, or URL paths from blocking rules.
  • Author Credit: The footer credit is enabled by default on new installations of this website-distributed build. Existing saved preferences are preserved when updating.
  • Customizable Block Actions:
    • Show a customizable message (supports basic HTML).
    • Redirect blocked visitors to a specific WordPress page.
  • Detailed Logging & Statistics (Opt-in):
    • Keep track of blocked requests (IP, country, reason, timestamp).
    • View statistics on blocked activity.
    • Option to anonymize logged IPs for privacy.

Looking to block VPNs, Proxies, or TOR users? For an additional layer of security and anonymity control, check out our companion plugin: VPN Guard!

External Services

Country lookups use the local database and do not send visitor IP addresses to MaxMind. Database downloads contact MaxMind from your server and send your license key.

  • MaxMind (GeoLite2 Database)
    • Purpose: Used to download the local geolocation database.
    • Data Sent: Your MaxMind License Key is sent to download the database.
    • Links: Terms of Use | Privacy Policy
  1. Download the plugin ZIP from the VPNDeals website.
  2. In your WordPress admin panel, go to Plugins > Add New > Upload Plugin.
  3. Select the ZIP, click “Install Now”, and then “Activate”.
  4. Follow the Express Onboarding wizard. The author credit starts enabled on new installations.
  1. Onboarding Wizard - Geolocation Source Step

    Onboarding Wizard - Geolocation Source Step

  2. Main Settings Tab (Blocking Mode and Block Actions)

    Main Settings Tab (Blocking Mode and Block Actions)

  3. Whitelisting Rules Tab (IPs, Roles, and URL Path Exclusions)

    Whitelisting Rules Tab (IPs, Roles, and URL Path Exclusions)

  4. Tools & Logs Tab (Activity Logging and Block Log Table)

    Tools & Logs Tab (Activity Logging and Block Log Table)

  5. Help & System Info Tab (FAQ and System Diagnostics)

    Help & System Info Tab (FAQ and System Diagnostics)

How do I get a MaxMind License Key?

You need a free MaxMind GeoLite2 account.
1. Sign up at MaxMind’s GeoLite2 Sign Up Page.
2. Log in and navigate to “Manage License Keys”.
3. Generate a new license key.
4. Copy the key and paste it into the Country Block settings.
NOTE: If your key shows as invalid immediately after creation, please wait 5 minutes and try the database download again, as activation takes a moment to propagate on MaxMind’s side.

Which Geolocation Source should I choose?

  • Local Database (GeoLite2): Recommended for all users. It’s fast, free, and provides reliable country-level blocking.

Is it compatible with caching plugins?

Country Block checks requests that reach WordPress. A CDN, server cache, or advanced-cache.php can serve pages before plugins run. With country rules enabled, this plugin sets DONOTCACHEPAGE and sends no-cache headers for requests it handles, but it cannot intercept existing upstream cache hits. Purge existing caches and bypass page caching for protected URLs, or apply matching country rules at your CDN. Test while logged out from both a blocked and an allowed location.

Not working

By Sarah Trägner (tragner) on July 9, 2026

Not working

Powerful Free Country Block Plugin — Works Even for WP Admin

By Tharusha Kavishan (kaviapps) on February 14, 2026

As a developer, most of the time I use paid plugins even for simple country blocks, but this one instantly blocks any country, including WP Admin, without requiring payment. It uses MaxMind, which is another great feature, because MaxMind is one of the best tools for getting a user's address from their IP. Thanks for making the WordPress community a great place!

Very solid country blocking plugin - features reach in the free version

By babini on January 1, 2026

I tested this plugin thoroughly and it works exactly as expected as I really needed it on a client`s website. You can block specific countries or allow only selected ones, and the rules are applied correctly. What really stands out is how many useful features are included in the free version compared to other plugins — things like IP, user role, and URL whitelisting, activity logging, and different blocking modes. Setup is straightforward, the interface is clear, and everything worked smoothly in real use. Definitely a very solid country-blocking solution.

A simple and reliable way to block traffic by country

By jesussuarez on December 27, 2025

I tried Country Block looking for a simple way to filter traffic by country without overcomplicating things, and honestly, it turned out to be a pleasant surprise. Everything is clearly explained from the start, the setup wizard is genuinely helpful, and you can have it working in just a few minutes.

The interface is clean and modern, with no confusing menus or hidden options. It feels thoughtfully designed and easy to use, even if you’re not very technical. I especially liked that it works properly behind Cloudflare and other proxies, which is something many similar plugins struggle with.

For a free plugin, it offers more than you’d normally expect: country and region blocking, IP and path exclusions, custom messages, and optional activity logs if you want visibility into what’s happening. It doesn’t aggressively push upgrades or fill the dashboard with annoying notices.

Overall, it’s a solid, well-built plugin that does exactly what it promises. If you need to control where your traffic comes from, Country Block feels modern, reliable, and refreshingly straightforward.

Amazing plugin

By micha99x on December 9, 2025

Completely free with no paid addons, and the automatic database updates are a huge plus. Honestly, what more could you want?

1.0.3

  • Restore PHP 7.4-compatible bundled dependencies and pin Composer’s build platform.
  • Enable the author credit by default on fresh installations of the website-distributed build, preserving existing saved preferences.
  • Preserve license keys, database update metadata, and unrelated options during AJAX and partial updates.
  • Prevent the footer credit action from resetting blocking rules.
  • Use one database download handler during onboarding.
  • Trust only the configured visitor IP header, falling back to REMOTE_ADDR.
  • Match redirect pages by path and query; fix plain-permalink exemptions and migrate old generated whitelist entries.
  • Validate IPv4/IPv6 CIDR ranges and match a whitelisted directory itself.
  • Validate database downloads before replacement, serialize updates, and invalidate country caches after updates.
  • Preserve HTML messages and anonymization on import; honor individual log-field preferences and escape CSV formula cells.
  • Add database readiness diagnostics and document full-page cache limitations.
  • Protect onboarding state changes with capability and nonce checks.

1.0.2

  • Compatibility: Full support verified for WordPress 6.9.1 and PHP 8.3+.
  • Security: Hardened internal access checks to prevent unauthorized settings modifications.

1.0.1

  • Redirect Loop Fix: Implemented a more robust method to prevent infinite redirect loops when blocking traffic and using the ‘Redirect to a WordPress page’ action. The redirect target is now automatically whitelisted by URL path.

1.0.0

  • Initial public release.
Back to top