There are many different ways to block Spam Ip address on WordPress comments and WordPress supported forums by using .htacess file or “IP blocker”.
A simple way of blocking IP addressed in WordPress is by using the .htaccess file. That’s if spam bot prevention such as google re-captcha and similar plugins fail.
Block Spam IP using .htaccess file
The easiest way to block any IP address is by using the .htaccess file usually located in the website folder (if you don’t have a file named .htaccess just create one), simply open your “.htaccess” file and add this script right at the end, these are some of the common spam Ip addressed which leave spam comments on WordPress blogs, of course, you will need to add your own deny IP addresses as you go.
# END WordPress <Files 403.shtml> order allow,deny allow from all </Files> deny from 220.127.116.11 deny from 18.104.22.168 deny from 22.214.171.124 deny from 126.96.36.199 deny from 188.8.131.52 deny from 184.108.40.206 deny from 220.127.116.11 deny from 18.104.22.168 deny from 22.214.171.124 deny from 126.96.36.199 deny from 188.8.131.52 deny from 184.108.40.206 deny from 220.127.116.11 deny from 18.104.22.168 deny from 22.214.171.124 deny from 126.96.36.199 deny from 188.8.131.52 deny from 184.108.40.206 deny from 220.127.116.11 deny from 18.104.22.168
Block Spam IP using “IP blocker” on Cpanel
You can simply use an “IP blocker” located on most modern web hosting providers that use Cpanel. This will automatically edit your .htaccess file and add the same code above to your .htaccess files.
When you open the “IP blocker” you can simply add your IP address in the input text box and click on “Add” to add the IP to your blocked IP database, you can also block domain names and IP ranges.
Note: You can specify denied IP addresses in the following formats:
- Single IP Address
- Implied Range
- CIDR Format
- Implies 192.*.*.*
You can simply remove IP addressed by deleting them from the IP blocker database. located under “actions tab”