# Geo Blocking plugin

**URL:** https://meta.discourse.org/t/geo-blocking-plugin/227824
**Category:** Plugin
**Created:** [May 23, 2022, 9:43am UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824 "2022-05-23T09:43:22Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [May 23, 2022, 9:43am UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/1 "2022-05-23T09:43:23Z")

</div>

**Summary** : Geo Blocking plugin for Discourse

:link: **GitHub** : [GitHub - communiteq/discourse-geo-blocking · GitHub](https://github.com/communiteq/discourse-geo-blocking)  
:arrow_right: **Install** : Follow the [plugin installation guide](https://meta.discourse.org/t/install-a-plugin/19157).  
:moneybag: **Client** : This plugin has been sponsored by [Sketchfab](https://sketchfab.com).

### Features

This can be used to completely block access to your forum for certain countries or networks, for example fraud prevention or to comply with sanctions.

The plugin leverages the MaxMindDB database that is already available in Discourse.

### Configuration

- Enable the plugin
- Add all networks you want to block to `geo_blocking_asn_blocklist`. Prefix the numbers with AS, so for example `AS12345`.
- Add all countries and regions you want to block to `geo_blocking_country_region_blocklist`. The following formats are accepted:
  - Full country name (for example: `Belgium`)
  - Country ISO code (for example: `JP` for Japan)
  - Full country name followed by a dot and then the region name (for example: `Switzerland.Jura`).

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/e/a/9eabbc1ae3d99ee7a9f640cfcaca3ea3a99f4d55.png)

- If you enable `geo blocking detailed reason` then the error message will contain the country/region or network that caused the user to be blocked.

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/a/6/fa6db38c98c2423ef20f14104230f06b4eefa41f.png)

versus

 ![image](https://global.discourse-cdn.com/meta/original/4X/0/b/6/0b66bef8f99c2017f3bad1c99b82b7a132fca07d.png)

- To test the plugin you can check `geo blocking log blocked` and/or `geo blocking log allowed` and inspect the `/logs` on your forum.

 ![image](https://global.discourse-cdn.com/meta/original/4X/4/5/2/452454ec009a2577f229d0fde582e074ea78d0b6.png)

For a full list of supported countries and regions, see [list\_of\_countries\_and\_regions.txt](https://github.com/communiteq/discourse-geo-blocking/blob/master/list_of_countries_and_regions.txt).

### Attention and Caveats

If anonymous visitors are being blocked, they could still get a cached version of the home page for around one minute.

The error page does not contain “Popular” and “Recent” topics because that would leak content to a blocked user.

---

_[View the full topic](https://meta.discourse.org/t/geo-blocking-plugin/227824)._
