I've had some people reading my Wordpress blog and leaving ugly messages. I would like to block their IP so that they can not even view it. I have code but don't know where to put it - instructions say in the .htacess file but I don't know where that is in Wordpress. Anyone help?
cPanel's IP Deny Manager. Use it to add the IP/s you have. That will modify (and/or create) the .htaccess file for you. Hey, you're probably wasting your time... I mean, these bots or folks are probably using proxies to spam your site; also disguising their real IPs.
If you're running ASP, I have a program that I wrote which you insert one line of code into your main index file and it bans by IP, wildcard IP or up to 200 individual countries. http://www.ontarioabandonedplaces.com/ipguardian Free. Doesn't cost a cent and no time limitations... just ASP source code
go under options/discussion, then at the bottom where it says block list, enter the IP you want to block and save
Any luck with the blocked IP? This is from wordpress <?php $block = array("xxx.xxx.xxx.xxx", "yy.yy.y.yyy"); if (in_array ($_SERVER['REMOTE_ADDR'], $block)) { header("Location: http://google.com/"); exit(); } ?> PHP: http://codex.wordpress.org/Combating_Comment_Spam/Denying_Access
You could also try the WP Ban plugin located here. That's a "beta" version for WordPress 2.5+. You should be able to ban IPs through that interface in your admin panel.
If you think the problem is from automated bots then you can install the cryptograph plugin. Once you add the small piece of code in the comments page it generates a captcha so only human visitors can enter comments. Cheers Col