Blocking visitors by country using htaccess (Firewall) can be useful in case your blog/website is experiencing high volume of attack from particular country. It can also be very useful in case your website is experiencing DDOS attack from particular country.
For the example, we have tried to block China to browse website.
Access your htaccess file from you Cpanel. Add the below code to your htaccess files and save it.
<Limit GET HEAD POST> order allow,deny allow from all deny from 126.96.36.199/24 deny from 188.8.131.52/23 deny from 184.108.40.206/22 </Limit>
To block all the visitor from particular country you need to find IP range of that country which you can get from ip2location website.