There are ways to block an IP address from spamming your site. You'll need to add the IP address to the restricted listing on the site. When the IP address tries to leave a comment the comment is posted in the trash automatically. I can block them from posting comments. Now I want to block them from accessing my site completely. How can you stop an IP address from opening up your site so they can't continue to add spam to the site that is thrown in the trash when it is posted. 
in Websites + Social Media by 6 24 64
If you are using any CMS like Wordpress then there will be any plugin to block IP addresses. Almost every platforms have plugins to block IPs to control spam. You can use the command ' Deny from xxx. xxx. xxx. xxx ' on htaccess file to block an ip. Replace xxx part with the Ip address to block.

If you want to block multiple ip addresses then you can use the below format in htaccess file.

Deny from xxx. xxx. xxx. xxx  yyy. yyy. yyy. yyy etc.

You can also block the entire subnet by using the command 'Deny from'
I fully understand this and I have done this. However, the only thing it seems to do is to dump the comment directly in the trash. It won't block the IP address from accessing my site completely. I am tired of cleaning up the trash and all the comments this one IP address keeps leaving on my site. All they seem to do is change their email address and come again. The comment is moved directly to the trash. Then I must block this email address so they can't comment again. I don't want them to even be able to open my website. That is what I need. 

1 Answer

0 votes

There is a lot of ways to do this but I prefer to use a security plugin that's called wordfence.

Not only you can block an IP Address but you can even block a whole country, just a computers address, a mobile address, a tablet address etc.

So many options using wordfence.

Hope this answers your question.

Best Regards,


by 6
4,249 questions
15,744 answers
4,200 users