How to block website visitors from certain countries?

Hi
Does anyone know if it's possible to block visitors from certain countries viewing your website? I've googled this but can't find a viable solution. I get a lot of traffic from China and India, they go straight from the homepage to the contact page and then spam me. I'm getting ridiculous amounts of emails a day now and I want it to stop!!

I've tried blocking the emails in C-Panel but new ones keep getting through. As I sell large items of furniture it's obvious that no one in either of these countries is ever going to purchase anything so I want to block access to the site completely.
Any ideas?

Thanks, Ali
 

jonny123

Free Member
Dec 8, 2010
74
7
UK
There are two things that you can do:

1. Block IP ranges in the .htaccess file so that they cannot see the site. Not a great idea, as it could mean blocking potential customers, friends etc who happen to be in those areas (I once spoke to a Brit living / working in Russia who was getting increasingly annoyed with the number of sites he could not visit. Plus, a lot of IP ranges to block.

2. Set up a better contact form. I have contact forms and hardly get spammed. CAPTCHA is your friend.

I now use Wordpress (they have some good plugins for contact forms) so not up to date with the best static html solutions.

I use the Wordpress version of this one, and get no automated spam: http://www.fastsecurecontactform.com/

Certainly worth looking at their stand-alone one - the html/php version.
 
Upvote 0

jonny123

Free Member
Dec 8, 2010
74
7
UK
Ah, I see.

You may want to create a new email address then .....

if the spammers have that email address on their databases it will still get spammed.

Another suggestion: create a Google account and forward all business emails there, set up filters for emails that you expect / are important (I think you should be able to set a filter for all emails that contain ".co.uk" and allow them in, for instance).

Then Google will sort out most of the spam. It all gets stored in the Spam folder so you can search that, just in case.

Another option ... if you just have the email address on the page, use obfuscation: http://www.fingerlakesbmw.org/main/flobfuscate.php

It creates HTML code for your email address. Most spam bots cannot read this.

A contact form is better though - with some you can set subjects, helps to spot incoming client queries.
 
Upvote 0

pressme

Free Member
Dec 5, 2009
37
1
Never place your email on your website in raw format, it will end up on many spam lists. If you want to place your email then use an image or say email me and myemail(at)thisdomain.com.

If you want to blacklist/greylist based on IP country there's a free database available from maxmind.com.

If you replace the email address with a form, you will need some kind of spam prevention such as capcha as already mentioned (personally I hate captchas).
 
Upvote 0

profitmagnet

Free Member
Sep 4, 2012
34
2
If I was in your case I would not block those countries but create a separate form for China and India saying " If you are from these countries contact here" and that contact form will be attached to a dummy email with an auto responder saying if we like your proposal we will get in touch. The reason I would do this is because of traffic even though it is a waste I would like my website be searched and visited for some reason which could help me in the long run. I know not many people will agree with this but this is just my thinking and you do not have to agree with what I say.
 
Upvote 0

pressme

Free Member
Dec 5, 2009
37
1
If I was in your case I would not block those countries but create a separate form for China and India saying " If you are from these countries contact here" and that contact form will be attached to a dummy email ....

You will need at least four options on your select 'UK', 'India', China', 'Everywhere else'. Some UK users may select the wrong one, leading to lost contacts. The responses from 'Everywhere else' may be of interest so need to be read anyway. The bots which deliver spam would ignore selections or post to all of them anyway.
 
Upvote 0
Block the bots from search engines like Baidu (Chinese) Yandex (Russian) then you won't get listed on them. They should read robots txt so you can stop them like that, if they ignore it them block the IP's they operate with in cPanel, you can block ban IP's as well for certain countries. I also block (in robots txt) the likes of google and bing from indexing my contact details etc, and I have the email address not in plain on the site.

But your problem is that your address is out there already, so a new one with some extra steps taken would help.
 
Upvote 0

chrislim2888

Free Member
Sep 11, 2012
1
0
If you are hosting in Linux, perhaps I may suggest you to block the unwanted country's IP address in .htaccess file. It won't be that difficult, by just get the relevant IPs and paste it into file will do.

Google visitor-blocker by country, you shall be able to find the solution.
 
Upvote 0

Latest Articles