I want to block traffic and visitors to my blogger.com blog from a certain country. In this case, those from .ru (Russian domains).

Is it possible to globally block these visitors? Would this be done through a pure JavaScript method?

1 Answer 1


No, you can't. You need access to the server administration tools (like .htaccess ) to flawlessly block IPs from a certain country.

The closest thing that can be done with JavaScript is to get the browser language preference and redirect browsers with Russian as their preferred language to another URL. However, this would block all people who are not in Russia and use their browsers in Russian (this includes a lot of people in former Soviet republics, and Russian language learners). This would also not block people who are in Russia, but use their browser in other language.

Anyway, blocking an entire country is not something I would suggest you to do, especially if you are only having problems with spam. What about all valid Russian-speaking people with good intentions that would be blocked? If that's the case (spam), I suggest you to instead replace the default Blogger system with the Disqus commenting system. It has many features, including a strong antispam protection that let you set blacklists.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.