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.
Key Features:
- Automatically allows the admin’s country on plugin activation.
- Temporary access via a customizable secret URL parameter (e.g.,
?MySecretKey=1
).
- Manual blacklisting of specific countries or IP addresses for added security.
- 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 "Blocked" page functionality—show a custom message or redirect to a specific page instead of the default 403.
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.