My blogs send me an email every time someone leaves a comment. I always look at the emails promptly, in case it’s either something I’d like to reply to, or a spam comment that has slipped through my anti-spam controls.
Sometimes spammers get carried away and try to leave multiple comments, all from the same IP address. That’s great, as then I ban them.
Here’s how to ban a spammer by IP address.
Set up email alerts
Log in to your WordPress Dashboard and go to the Discussion Settings.
E-mail me whenever boxes beside
Anyone posts a comment and
A comment is held for moderation. That will trigger an email to your WordPress Admin email address when someone attempts to leave a comment.
Get the IP address
In the email, the IP address is listed by the comment author’s name, as in the screenshot here.
Alternatively, if you visit the Comments section of your blog’s Dashboard, the IP address appears beside the Comment, as shown in the second screenshot.
Copy that IP address.
Ban an IP address
Next go to the Discussion Settings in your blog’s Dashboard and scroll down to the
Comment Blacklist section.
Paste in the IP address you want to ban.
Finish up by clicking the
Save Changes button at the bottom of that screen.
You don’t have to ban by IP address. You can also ban by words in the body of the Comment, commenter name, URL or email address.
Don’t give spammers a third chance
I don’t bother trying to manually ban all spam commenters that make it through. But if a second comment is published unchallenged by my anti-spam software then I add the spammer to my blacklist.
I’ve noticed that spammers spot when they’re on to a good thing. For example, I’ve had particular posts that have attracted dozens of spam comments over a short period, while other posts remain untouched.
Control the comments
If you value your blog you need to keep firm control of the Comments. Immediately remove any that are obvious spam, and unpublish any that look like spam until you’ve checked them out.
Remember that it’s your blog. If people leave comments that are disruptive in some way, then it’s your right to edit or not approve them.
For example, I don’t want people using swear words on my blog. If their comment contains words I don’t accept I’ll replace the word with *** and make a note that it’s been edited.
I think that’s only ever happened once … Obviously commenters on this blog are people of immense good taste. 🙂