Q: Does this add-on require Cloudflare or an external API key?
A: No. Block Country includes a built-in DB-IP country database, so country detection works completely out of the box without Cloudflare, third-party accounts, or API keys.
Q: I use Cloudflare or a reverse proxy. Do I need to configure anything?
A: If your site is proxied through Cloudflare (orange cloud enabled), Nginx reverse proxy, or a CDN, make sure your web server or XenForo is configured to restore real visitor IP addresses
$_SERVER['REMOTE_ADDR']. Otherwise, the server may see Cloudflare's US-based proxy IP instead of the visitor's actual country.
You can ensure XenForo reads Cloudflare's real visitor IP by adding the following to your
src/config.php file
(only if your server isn't already restoring real IPs via mod_remoteip or Nginx set_real_ip_from):
Code:
if (isset($_SERVER['HTTP_CF_CONNECTING_IP']))
{
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
}
Q: Can I use the AI and scraper bot blockers without blocking any countries?
A: Yes! Simply leave the Allowed countries field completely empty. Visitors from all countries will be allowed through, while any AI crawlers, SEO scrapers, or custom bots you select will still be blocked immediately with a 403 Forbidden response.
Q: Why did Googlebot or Facebook link previews stop working after I restricted countries?
A: Many major search engines and social media preview crawlers operate from servers located in the United States. If you restrict access to countries outside the US (for example, only allowing ES), those bots will also be blocked unless you explicitly whitelist them under allowed search bots.
Q: Can I remove existing bot-blocking rules from my .htaccess file?
A: Yes. Once you enable the corresponding bots in Block Country, you can safely remove duplicate user-agent blocking rules from your .htaccess
(or Nginx config) file. Managing them through the add-on is cleaner, easier to update from the Admin CP, and helps avoid accidentally blocking whitelisted search engines or link preview crawlers. (Keep any other non-bot security or IP rules you have in
.htaccess).
Q: I accidentally locked myself out of my forum! How do I fix it?
A: Right after installation, or while you still have your Admin CP tab open, you can simply update the options directly. Otherwise, if you forgot to include your own country in the allowed countries list and can no longer access the Admin CP, you can temporarily disable add-on listeners via your
src/config.php file by adding:
Code:
$config['enableListeners'] = false;
Once added, log into your Admin CP, update your allowed countries setting, and remove that line from
src/config.php