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

Blocking specific countries visiting my website



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





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 (


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.



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

<Limit GET POST>
deny from
allow from all


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.



Re: Blocking specific countries visiting my website

What about if I have Windows Hosting? and IIS?

Super User III
Super User III

Re: Blocking specific countries visiting my website



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
Check out my site! | I drink and I know things. Especially about websites and web hosting.
* Please note that I offer free advice on this forum. If you would like personalized help, please contact me. Otherwise, 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