- Compatible XF 2.x versions
- 2.3
Block Country is a lightweight, performance-focused security and access control add-on for XenForo. It allows you to restrict your community to specific countries while giving you one-click control to block aggressive AI crawlers, SEO scrapers, and automated HTTP bots before your forum even loads. By intercepting unwanted traffic early and returning a lightweight 403 Forbidden response, this add-on protects your content from unauthorized scraping and significantly reduces unnecessary server load-all without hurting your search engine rankings or social media link previews.
Easily restrict access to specific countries by entering comma-separated two-letter ISO country codes (e.g., US, GB). Leave blank to allow global traffic while still using the bot-blocking features. Keep your SEO and link embeds intact even if you block the countries those crawlers originate from (such as blocking the US while keeping Googlebot active). Includes toggles for...
Search engines:
Googlebot, Bingbot, YandexBot, Applebot, DuckDuckBot, Baiduspider, Yahoo! Slurp, Sogou, SeznamBot, and iaskspider.
Social & Link previews:
Facebook, X (Twitter), Telegram, Discord, WhatsApp, and LinkedIn.
Testing & Validation tools:
Google PageSpeed / Lighthouse and W3C Validators (including Schema Markup Validator support).
One-Click AI crawler blocker:
Prevent AI companies from scraping your community's discussions for training data. Includes individual toggles for OpenAI (GPTBot), Anthropic (ClaudeBot), Google-Extended, Meta AI, ByteDance (Bytespider), Perplexity, xAI (Grok), DeepSeek, Common Crawl, and 15+ other AI bots.
SEO scraper & Automated script blocker:
Stop bandwidth-heavy SEO tools and automated scraping scripts in their tracks. Block Ahrefs, Semrush, Majestic, Moz, DataForSeo, Headless Chrome, cURL, Wget, Python (python-requests), Go, Node.js (axios/node-fetch), and Perl HTTP clients.
Custom user-agent blacklist:
Easily add your own custom user-agent strings or bot keywords (one per line) to immediately block specific unwanted crawlers regardless of their country of origin.
See the FAQ section for more information.
Important notes:
-You can customize the 403 block page message by editing the add-on's phrases.
-Works seamlessly with or without Cloudflare. If you use Cloudflare, see the FAQ section.
-If you want to see the 403 block page in action, temporarily exclude your own country code from the Allowed countries list (e.g., enter ZZ) and visit your forum in an incognito window-just remember to add your country back afterward so you don't lock yourself out!
-This add-on includes IP geolocation data from DB-IP.com, with attribution displayed on the 403 Forbidden page in accordance with the CC BY 4.0 license.
You can check out the screenshots below.
Result:
Easily restrict access to specific countries by entering comma-separated two-letter ISO country codes (e.g., US, GB). Leave blank to allow global traffic while still using the bot-blocking features. Keep your SEO and link embeds intact even if you block the countries those crawlers originate from (such as blocking the US while keeping Googlebot active). Includes toggles for...
Search engines:
Googlebot, Bingbot, YandexBot, Applebot, DuckDuckBot, Baiduspider, Yahoo! Slurp, Sogou, SeznamBot, and iaskspider.
Social & Link previews:
Facebook, X (Twitter), Telegram, Discord, WhatsApp, and LinkedIn.
Testing & Validation tools:
Google PageSpeed / Lighthouse and W3C Validators (including Schema Markup Validator support).
One-Click AI crawler blocker:
Prevent AI companies from scraping your community's discussions for training data. Includes individual toggles for OpenAI (GPTBot), Anthropic (ClaudeBot), Google-Extended, Meta AI, ByteDance (Bytespider), Perplexity, xAI (Grok), DeepSeek, Common Crawl, and 15+ other AI bots.
SEO scraper & Automated script blocker:
Stop bandwidth-heavy SEO tools and automated scraping scripts in their tracks. Block Ahrefs, Semrush, Majestic, Moz, DataForSeo, Headless Chrome, cURL, Wget, Python (python-requests), Go, Node.js (axios/node-fetch), and Perl HTTP clients.
Custom user-agent blacklist:
Easily add your own custom user-agent strings or bot keywords (one per line) to immediately block specific unwanted crawlers regardless of their country of origin.
See the FAQ section for more information.
Important notes:
-You can customize the 403 block page message by editing the add-on's phrases.
-Works seamlessly with or without Cloudflare. If you use Cloudflare, see the FAQ section.
-If you want to see the 403 block page in action, temporarily exclude your own country code from the Allowed countries list (e.g., enter ZZ) and visit your forum in an incognito window-just remember to add your country back afterward so you don't lock yourself out!
-This add-on includes IP geolocation data from DB-IP.com, with attribution displayed on the 403 Forbidden page in accordance with the CC BY 4.0 license.
You can check out the screenshots below.
Result: