开发者 | brstefanovic |
---|---|
更新时间 | 2025年10月16日 18:03 |
PHP版本: | 7.2 及以上 |
WordPress版本: | 6.8 |
版权: | GPLv3 or later |
版权网址: | 版权信息 |
.mmdb
database file.?MySecretKey=1
)./wp-content/plugins/
directory, or install via the WordPress "Add Plugin" feature..mmdb
file somewhere on your server where PHP can read it (optional but recommended for offline mode)..mmdb
file for offline lookups.You can download the free GeoLite2 Country database from MaxMind (requires a free account). Upload the .mmdb
file to a readable location on your server (for example, inside wp-content/uploads/
) and paste the absolute file path into the GeoIP Database Path field on the plugin settings page.
Local GeoIP databases occasionally have outdated entries. MaxMind updates GeoLite2 weekly, so download the latest release when you notice inaccuracies. You can also manually add or remove countries on the settings page to adjust who is allowed or blocked.
You can add your IP manually to the temporary whitelist by using the URL parameter (?YourSecretKey=1
), or log in as an admin (if admin bypass is enabled). Alternatively, you can deactivate the plugin via FTP or your hosting control panel and adjust settings.
The plugin stores IP addresses and (optionally) country codes in a custom log table when visitors are blocked. This is purely for security and administrative review. Remove or adjust this functionality as needed to comply with privacy regulations.
Yes, by default, if you are logged in with manage_options
capability. You can change or remove this bypass in the plugin code.
Yes. The settings page lets you change the block page title/message (with placeholders for {ip}
, {country_code}
, and {reason}
), choose the HTTP status code to send (403, 410, or 451) or redirect visitors to a custom URL with the status code of your choice.
Stay in the default allowlist mode when you want to permit just the countries you list. Switch to “Use Blacklist Mode” to list only the countries you want to block—everything else will be allowed automatically.
Use the “Clear Logs” button on the Block Logs screen to wipe all entries instantly. You can also configure automatic log cleanup from the settings page—set the retention to 0
days to keep everything indefinitely.
.mmdb
database file, and display status messaging for admins.