One feature that is missing in WordPress is a decent way to filter out comments by IP Address. I decided to tackle that today. First I will do it via a quick hack and then expand it to more tightly integrate with the backend. If someone would like to figure out how to make it a plugin, that would be awesome.
1 2 3 4 5 6 7 | global $wpdb; $testIp = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] ); $ipResults = $wpdb->get_results("SELECT * FROM wp_banned WHERE IpAddress = '".$testIp."'"); if(count($ipResults) > 0) return -1; |
Now I just need to figure out how to add some nice buttons to the comment page to “Ban and Spam” comments…