Block ’em

by | Dec 22, 2019

Who doesn’t want more website traffic? You, if it’s coming from the wrong sources. Too many simultaneous “hits” in a short time span can overload your host server slowing your site to crawl or totally taking it off line due to exhausted resources.

Finding out who or what, in the case of search or marketing “bots”, is easy using the application Awstats found in your hosting cPanel:

awstats

Within Awstats you will be able to see, by IP address, who is visiting your site. If you see an inordinate number of hits coming from the same source, you may want to investigate further. You can perform an IP address lookup using an online resource such as the site; What is My IP Address. If your search produces dubious results such as ABC Marketing in Shanghai, well, chances are this is undesirable traffic.

Blocking the worst offenders is an easy task using the tool “IP Blocker” found in your hosting cPanel:

IP Blocker

Within, you will have the ability to block IP addresses individually or within a range of addresses.

Should your web host not provide access to this handy tool, you can achieve the same results by a simple edit to your WordPress .htaccess file. Using your site’s file manager or an FTP client such as Filezilla, Without getting technical, the .htaccess file gives instructions to your hosting server as to what to do. In its original form, the WordPress .htaccess file resembles this:

wordpress htaccess file

Editing this file by adding some instructions to block traffic from certain IP addresses is easy and looks like this:

block ip addresses

In the above example, I am telling the server to block traffic from five entities. In editing, you add one IP address per line and these edits are placed at the top of the .htaccess file, before the line: # BEGIN WordPress. Though not too much to this edit, here’s an online resource to help: Block IPs with.htaccess.

That’s all, folks, thanks for reading!

Share This