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 184.108.40.206/24 deny from 220.127.116.11/23 deny from 18.104.22.168/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.