Block access in India

Hello everyone, my website is currently selling to customers all over the world, but now the Indian market has many people entering SEO Spam, not real customers. So what if I want to temporarily block India?

Sincerely thank

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.


Site Moderator
Site Moderator badge
March 4, 2022

Hello there,

You can block access to your site for certain countries but there are a few things you need to implement first.

  1. Kepp your WordPress version up to date. Whenever there is a new version available for an update, go for it. If your website is keen to struggle (having issues) with new versions, you can first take a backup of your site before proceeding with the update.
  2. Regularly update your themes and plugins. Hackers gain access to any website via an outdated plugin or theme or weak credentials.
  3. Update your administrator login credentials, you can also use a username different from admin/administrator.
  4. Install plugins/themes only from legit sources. You can do a little research before installing a plugin, sometimes they can be really outdated without new releases and with very low download counts and no feedback at all which can serve as a warning for you.
  5. Install a security plugin that can track down issues for you, such as vulnerability issues, unknown logins, failed login attempts, brute force attacks and so on.

You can also check this article on SEO-SPAM and while I can not recommend their product because I haven’t used it, their article on SEO-SPAM covers pretty much everything that you need to know.

Hope that this helps!

Site Moderator
Site Moderator badge
March 4, 2022

Hi @bietduoc,

You can do this using CSF (ConfigServer Firewal) as well. In order to block a country you can use the CC_DENY option which accept two-letter country codes such as US, GB and etc.

In order to list more than one country you just need to separate them using comas:


You may find a list of ISO 3166-1 alpha-2 codes at

If you’re not familiar with CSF or you want to install it on CentOS or Ubuntu droplet check out this mini tutorial:

For CentOS:

and for Ubuntu:

Hope this helps!