Block Spam comments using PHP code

The following code is from official WordPress.org < ?php $block = array("xxx.xxx.xxx.xxx", "yy.yy.y.yyy"); if (in_array ($_SERVER[‘REMOTE_ADDR’], $block)) { header(“Location: http://google.com/”); exit(); } ?> I’ve added the read from file function and store the values into the array. The following code will check the IP does it existing in the array, if the IP is exist, …

Block Spam comments using PHP code Read More »