HOW TO BLOCK COUNTRIES FROM ACCESSING YOUR SITE:

Simple analogy: North Korea is not interested in you visiting their country, why would you be interested in having them visit your website?

You may have a simple boutique website that sells custom wares to an audience in the United States. You do not sell outside the States, yet you are bombarded by comments or subscribers from China, Russia, North Korea, etc. Clearly this traffic is unwanted. The good news is, you can block this nonsense – without a plugin!

What’s required here, is access to your .htaccess file. You can find this file by logging into your webhost control panel file manager or by using an FTP client such as Filezilla. (Free tool for PC and Mac). The basic WordPress .htaccess file is quite small and looks like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

This is a simple text file (.txt) and can easily be edited within Filezilla or with a text editor such as Microsoft Notepad.

Next Step:

Head over to this free website: CIPB, which allows you to generate code to add to your .htccess file to block website visitors/traffic from the countries of your choice.

Now that you have the code, add it to the bottom of your .htaccess file and save the file to your webhost with either of the methods described above. Voila! you have blocked all web traffic, visitors, etc. from undesirable countries.

Share This