Advanced Country Blocker
Advanced Country Blocker helps you secure your WordPress site by restricting access based on the visitor’s geolocation (country) or IP address. Upon activation, the plugin detects the activating admin’s country and automatically sets that as the only allowed country. All other visitors from different countries are blocked, unless they use a secret key parameter to temporarily whitelist their IP. Country detection uses the privacy-friendly ip-api.com service by default but can be switched to a fully offline MaxMind GeoLite2 (or compatible) database file once you configure a local copy. Key Features: Automatically allows the admin’s country on plugin activation. Flexible IP-to-country lookups – start with the built-in ip-api.com integration and optionally switch to an offline MaxMind GeoLite2 Country (or compatible) .mmdb database file. Allowlist or blacklist mode – choose whether the country list acts as an allowlist or blocklist without re-entering countries. Temporary access via a customizable secret URL parameter (e.g., ?MySecretKey=1). CAPTCHA Challenge – allow blocked visitors to solve a CAPTCHA to gain temporary access (supports Google reCAPTCHA v2/v3, hCaptcha, Cloudflare Turnstile). Real-Time Activity Monitor – live dashboard showing active visitors, recent blocks, and traffic statistics. Analytics Dashboard – comprehensive charts and statistics about blocked attempts. Manual blacklisting and safelisting of IPs for added security and to accommodate uptime monitors. Optional email alerts when new visitors are blocked. Admin bypass so logged-in admins can always access the site (toggleable in the code). Detailed logging of blocked attempts in a custom database table, displayed in the WP admin. Custom response controls – personalise the block page title/message, choose the HTTP status (403, 410, 451) or redirect to any URL. Automatic log cleanup with configurable retention plus a one-click “Clear Logs” button. Use the plugin settings page (Country Blocker menu in WP admin) to configure the list of allowed countries, blacklisted countries, blacklisted IPs, and whether email alerts are enabled. License This plugin is open-sourced software licensed under the GPLv3 or later. External Services By default this plugin contacts the ip-api.com geolocation service to detect visitor countries. You can disable all external lookups by switching the IP lookup method to the local MaxMind database in the settings.
Top keywords
- country9×2.51%
- admin5×1.39%
- blocked5×1.39%
- countries5×1.39%
- access4×1.11%
- database4×1.11%
- visitors4×1.11%
- com3×0.84%
- ip3×0.84%
- ip-api3×0.84%
- ip-api com3×0.84%
- maxmind3×0.84%
IP Locator
IP Locator is a country and language detection tool for WordPress. It is fast, reliable and plug & play. It can detect and render the country, the main language and the country flag of each visitor of your site. It provides: a strong, accurate and ultra-fast IP and country detection; many shortcodes to display country names, languages and flags (emoji or vectorized); a shortcode to conditionally hide or show strings or other shortcodes; a CSS modifier to add a country-specific class to the body tag of your site; an automatic system to be always up to date (no API key, no IP data files to manually import); a full-featured API for plugins / themes developers. For full details, you can browse the shortcodes list or the API description (for developers). IP Locator can be used too to report the following main items and characteristics: KPIs: number of detected countries and languages, accesses breakdown and detection ratio; countries for real humans with public IPs; languages for real humans with public IPs; metrics variations; metrics distributions; full list of countries per channel; full list of countries per client (requires the free Device Detector plugin). Technically, IP Locator: works on dedicated or shared servers; can detect the source IP even behind proxies or load-balancers; can use AWS CloudFront, Cloudflare and Apache mod_geoip to speed-up detection; natively supports APCu caching(1) and all other dedicated object caching mechanisms, like Memcached or Redis; has a minimal footprint in the page rendering time; runs its data updates in background, without impact on the website speed; is fully compatible with multisites; natively supports names and languages localizations(2). (1): APCu needs to be activated on your server if you want to use it in IP Locator. (2): PHP Intl extension needs to be activated on your server if you want to use it in IP Locator. IP Locator uses IP data I curate myself and I publish via my own servers exclusively for IP Locator. Data is CC0 licensed. IP Locator accesses this service on a regular basis (if the option is checked) to maintain an up-to-date version of the data. IP Locator supports an extensive set of WP-CLI commands to: get location detail: see wp help location describe for details; display IP Locator status: see wp help location status for details; toggle on/off main settings: see wp help location settings for details; display location and languages statistics: see wp help location analytics for details. For a full help on WP-CLI commands in IP Locator, please read this guide. IP Locator is part of PerfOps One, a suite of free and open source WordPress plugins dedicated to observability and operations performance. IP Locator is a free and open source plugin for WordPress. It integrates many other free and open source works (as-is or modified). Please, see ‘about’ tab in the plugin settings to see the details. Developers If you’re a plugins / themes developer and want to take advantage of the detection features of IP Locator, visit the GitHub repository of the plugin to learn how to use it. Support This plugin is free and provided without warranty of any kind. Use it at your own risk, I’m not responsible for any improper use of this plugin, nor for any damage it might cause to your site. Always backup all your data before installing a new plugin. Anyway, I’ll be glad to help you if you encounter issues when using this plugin. Please read carefully the FAQ at the bottom of this page before requesting support. Privacy This plugin, as any piece of software, is neither compliant nor non-compliant with privacy laws and regulations. It is your responsibility to use it – by activating the corresponding options or services – with respect for the personal data of your users and applicable laws. This plugin doesn’t set any cookie in the user’s browser. This plugin may handle personally identifiable information (PII). If the GDPR or CCPA or similar regulation applies to your case, you must adapt your processes (consent management, security measure, treatment register, etc.). Donation If you like this plugin or find it useful and want to thank me for the work done, please consider making a donation to La Quadrature Du Net or the Electronic Frontier Foundation which are advocacy groups defending the rights and freedoms of citizens on the Internet. By supporting them, you help the daily actions they perform to defend our fundamental freedoms!