cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution

Blocking specific countries visiting my website

Hi,

 

Would like to ask for help to know how to block all visitors of my website coming from a specific country?

 

Thanks!

 

4 REPLIES 4
Solution

Re: Blocking specific countries visiting my website

Hello ericonolasco,

 

So in regards to blocking specific countries you will need to acquire the ip address range using 3rd party sites but for example if I was in another country and wanted to block the united states I could use code like this:

This code was generated using a 3rd party site (https://www.countryipblocks.net)

 

Once you have the code generated you can place it within your .htaccess file, I have included a link to more info regarding that if you are not familiar.

(https://www.godaddy.com/help/what-is-htaccess-2504)

 

(ip address range in example is not complete due to character restrictions and does not work)

<Limit GET POST>
deny from 1.1.1.1.0
allow from all
</Limit>

 

Mike L. | WebPro

Re: Blocking specific countries visiting my website

Thanks a lot, Michael. 

 

Big help on how I can setup blocking specific countries accessing my site.

 

Erico

Re: Blocking specific countries visiting my website

What about if I have Windows Hosting? and IIS?

Super User III
Super User III
Solution

Re: Blocking specific countries visiting my website

@omarsoft2020 

 

It should work the same. You would still have an web.config file in a WordPress installation on Windows, which acts like a .htaccess does on a Linux system. You should be able to edit said file just like an .htaccess, add the code, and it should work. For further help you may have to contact support.



I am a GoDaddy End User - Just Like You
* Please note that I offer free advice on this forum. I DO NOT answer private messages. Please ask your question in the proper forum so the answer can assist EVERYONE in the community and not just you. Thanks! *

Once your issue is resolved,
please be sure to come back and click accept for the solution

Get Better Support on the Community Boards!
Etiquette When Asking for Help from the Community