View Full Version : Wordpress - Where do I put code to block IP addresses?
dquarles220
Feb 5th 2008, 9:21 pm
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?
Webray
Feb 5th 2008, 9:39 pm
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.
Benson
Feb 5th 2008, 11:25 pm
use ip blocking plugins to block IP's
rapsap
Feb 7th 2008, 6:21 pm
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
sultanofseo
Apr 25th 2008, 3:09 pm
go under options/discussion, then at the bottom where it says block list, enter the IP you want to block and save
Alinax
May 1st 2008, 5:43 am
can add in .htaccess Deny from ip adress
anton-io!
May 12th 2008, 2:19 pm
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();
}
?>
http://codex.wordpress.org/Combating_Comment_Spam/Denying_Access
fish
May 12th 2008, 5:12 pm
You could also try the WP Ban plugin located here (http://lesterchan.net/wordpress/downloads/). That's a "beta" version for WordPress 2.5+. You should be able to ban IPs through that interface in your admin panel.
anton-io!
May 12th 2008, 5:55 pm
WP Ban plugin
Very nice plugin, already installed & working
Thanks! :D
iceman007
May 13th 2008, 7:37 pm
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
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.