
Okay, that may have worked. I guess I'll find out soon enough.
Recently, there's been someone I...haven't cared to listen to particularly. And so, I idly scooted around the internet and thereby learned that no, there isn't any good way to ban people from your blog when aforementioned-blog is hosted on Blogger. You can delete comments, screen comments, restrict comments to a certain group of people, but you can't--for example--slap a "COOTIES!" sticker on someone's IP address.
There's no good way to ban someone, but after some experimentation, I found a way. As I'll explain later, it's not particularly robust protection, but it may be better than nothing.
So here's how to quasi-ban someone so they can't view your blog:
~~~~~~~~~~~~~~~~~~~~
Troll Bouncing Instructions
1) You do need the troll's IP address, which is a pain because Blogger doesn't give it to you.
However, if you have a hit counter service such as StatCounter, you may be able to figure it out. First, check the time stamps on the blog comments your troll has made.
Next, go into the statistics of your hit counter service and try to figure out which commenter has visited your blog at the same time as all those comments were left. Unless you have a high traffic blog, you might be able to sort out who your troll is.
Once this is done, record their IP address. You will need it later.
2) Now you're ready to wield your ban-hammer, flimsy as it is. To do so, you will need the following code:
~~~~~~~~~~~~~~~~~~~~
<!-- BEGIN TROLL BOUNCING -->
<script src="http://www.jjdebenedictis.com/ipnab.php"></script>
<script>
var ip=getip();
if (ip=="xxx.xxx.xxx.xxx")
{
window.location="http://www.dailysquee.com";
}
</script>
<!-- END TROLL BOUNCING -->
~~~~~~~~~~~~~~~~~~~~
Just so you know what this does, the first line returns a function containing your blog visitor's IP address via a bit of code on my personal website. (If my website goes down, this fix will stop working.) The rest of the code tests to see if the person visiting your blog has the same IP address as the troll, and if so, it bounces them to another website.
~~~~~~~~~~~~~~~~~~~~
3) Now log in to blogger and go to your "Dashboard" (where all the controls are.)
Up at the top, click on the "Design" tab, then click "Edit HTML". (See the image below.)

4) You see that heading that says "Backup/Restore Template"? I recommend you click "Download Full Template" and save the file to your computer before proceeding. That way, if something goes wrong and your blog gets borked, you can restore it by uploading the saved file.
5) In the section labelled "Edit Template", look in the code for the <head> tag. Once you've found it, insert a few spaces just after it and then paste in the code from Step (2) above.
6) Now: See the little xxx.xxx.xxx.xxx in the code? You have to replace that with the IP address of your troll.
By the way, if you want to ban more than one person, you would replace
if (ip == "xxx.xxx.xxx.xxx")
with
if (ip == "xxx.xxx.xxx.xxx" || ip == "yyy.yyy.yyy.yyy")
for two trolls or
if (ip == "xxx.xxx.xxx.xxx" || ip == "yyy.yyy.yyy.yyy" || ip == "zzz.zzz.zzz.zzz")
for three trolls (and so on), where the x's, y's and z's get replaced by IP numbers.
7) I recommend you preview the page just to make sure things look normal. Remember, the only person who is supposed to see something weird is the troll. Everyone else, including you, should just see your regular old blog.
8) If everything looks completely normal, save the changes and log out. Your troll has hopefully now been bounced.
(By the way, if you leave the IP address as xxx.xxx.xxx.xxx, then no one is going to trigger it, i.e. you can put the code in now and defer adding an IP address until you have someone you want rid of.)
9) If you want to test the code is working, put your own IP address into it and try to get to your blog. If you can't, then hurray! The code works. Go back into your blogger dashboard (which you won't be blocked from) and delete your IP address from the code to restore your access.
~~~~~~~~~~~~~~~~~~~~
So what exactly, you ask with concern, is the troll going to experience? After all, we are kindly, moral creatures here and would not wish harm upon our trolls.
Well, when they try to view your blog, they will instead get taken to The Daily Squee, where they can frolic among photos of adorable puppies and kittens. (Or eat them. I don't know. Whatever trolls do when they're confused.)
Okay, now the caveats.
This form of banning is stupidly easy to evade. For obvious reasons, I won't explain how to do it here, but anyone with even a modest understanding of how these things work can get past this sort of defence in five seconds flat.
Furthermore, some people's systems are set up in such a way they won't even notice you've done this.
So this isn't a good way to handle smart trolls, but thankfully some of the more obnoxious ones don't fall into that category. As long as they also fail to be lucky trolls, you're cooking with diesel.
Second caveat: Even if this works, someone who reads your blog via an RSS feed probably can still view your blog contents that way. They just can't show up and leave comments anymore.
Third caveat: As those who know how to get around this can attest, your troll may find that some of the time it can access your blog and sometimes it can't. With more hit counter snooping, you may be able to block their other means of entry.
One last note: The code should work on any HTML based webpage including blogs not hosted on Blogger. Just make sure you put the code right after the <head> tag and substitute in the troll's IP address correctly.
Happy Troll Bouncing!
PS - Brave New World, who recently left blogging due to trolls, suggested a very elegant alternative to the method mentioned above. It prevents the troll from accessing the comments form, but not from reading your blog. The troll might even be fooled into thinking the problem is with Blogger! This method is a little harder to implement, but here's how to do it:
1) Go into your template. Make sure to click the "Expand Widget Templates" option.
2) Do a search for "comment-form". Change <div class='comment-form'> to <div class='comment-form' id='comment-form'>.
3) Add the following script AFTER the <!-- end outer-wrapper --> comment:
~~~~~~~~~~~~~~~~~~~~
<!-- BEGIN TROLL BOUNCING -->
<script src='http://www.jjdebenedictis.com/ipnab.php'/>
<script language='javascript'>
var ele = document.getElementById("comment-form");
var ip=getip();
if (ip=="xxx.xxx.xxx.xxx")
{
ele.style.display = "none"
}
</script>
<!-- END TROLL BOUNCING -->
~~~~~~~~~~~~~~~~~~~~
4) Of course, change the "xxx.xxx.xxx.xxx" to whatever IP address you want to block from commenting.
PPS - Oh, and, um, if you're specifically having trouble with this person, email me at jen_deben ~at~ yahoo ~dot~ ca and I can give you their IP address.

18 comments:
There's also the caveat that someone with a modest understanding of these things can also figure out the address of the person you're blocking.
Not that it matters. I just know you're not blocking me cuz I don't live in that state (whew!).
It's a pain to have to do this. I think that other platforms allow you to block ip addresses and I'm still toying with the idea of moving across to Wordpress.
I admire your ingenuity in doing it! I just hope I never need it.
wow! this is really helpful advice (although i feel really dumb- because i don't know what an ip address is!) but it's so sad that people feel the need to be SO NASTY that they make measures like this neccessary!
although, now i'm going to be super-worried if i ever end up at a kitten site instead of a blog!!! oh man! :)
Adam: There's something I hadn't considered. Thanks for pointing it out to me.
Of course I'm not blocking you; you're awesome! Plus, you're not looking at a kitten right now, are you? :D
FairyHedgehog: Yes, I think Wordpress does allow you more flexibility. Of course, it's never been a problem for me before. I've had a few problematic people, but not interacting with them is often all that's required for them to drift away again.
Aspiring_X: Maybe for April Fool's day I'll send everyone to the kitten site. Mwahahahaha!
But don't worry; you're definitely one of the commenters I like! :)
Sending everyone to the kitten site for April Fool's Day sounds like a laugh!
Great info. Thanks for sharing, and I hope it helps end your days of trolliciousness.
Not sure of the syntax in Javascript, but I bet you could obfuscate that IP if you wanted to. Something like:
var ipBlock = ((5+6)*6) + "." + ((3*3)*(3+1+1+1+6)) + "." + //etc.
if (ip==ipBlock)
{
//send to dailysquee
}
There's probably a better way to obfuscate (binary? hex?). That's just off the top of my head.
FairyHedgehog: Or I could Rickroll you all... }:D
Josh: Ah, they were mostly over, but given that Blogger doesn't allow people to block by IP, I thought it was useful information to put out there.
Adam: Ah, very clever. I may implement that, if you don't mind!
It's all yours :-)
Apparently I've been out of the loop longer than I thought. And I need to send this to a certain friend of mine who is currently experiencing a nasty anonnymous troll.
Adam: Thanks!
Sarah: I hope it can help your friend. The anonymous ones are often the most reprehensible.
I just checked out that website link, and that's certainly a bizarre world that person lives in. If she were that awesome with awesome sauce, I'm sure she wouldn't need to constantly say how people hate her and she doesn't care. Sad, really. You defnitely are better off not dealing with her.
JJ,
Once again, you are my idol. I've been dying to post your fix, but I didn't want certain people to discover certain things. I love the way you got around that :)
If you ever get to the point where you want to upgrade from Blogger to a hosted solution, I've got a less transparent method to share with you.
Writtenwyrdd: She's not all bad--I had a pleasant conversation with her about physics a few weeks ago. It's just that when she gets upset, she comments repeatedly, doesn't listen to other points of view, and is often insulting. I actually feel badly about doing this, but I also wasn't willing to go through the wringer again.
Angela: Ooh, ooh, geek-love! I do have a hosted website, so I'd be happy to hear it. The diabolical .htaccess solution, yes? :D
Feel free to point anyone you think needs to implement this solution to this post.
So, once I make it past the first giant hurdle of actually finishing AND polishing my novel, then jump even higher and land an agent, then surpass all previous efforts with a mighty leap and find a publisher...
THEN I will have to start a blog and learn how to do all of this...this stuff?!?!
Good grief!!!
Miss Sharp: I hope you NEVER have to learn to do this stuff. And if you do, come ask me to help. I'm a geek; I love this jazz. :-)
You had a troll?! My, I haven't been around for a while, have I?
Your techno solutions are most evil. The Koala salutes you.
McKoala: Trolls are no match for goblins. You should know that. :)
Post a Comment