Our website has been hit by a particular IP address bringing the site down. My site has been suspended for the same reason. I have been told to add a line of code to block the particular IP address.
I have googled and found few lines of php code.
<pre style="width: 703.656px; overflow: auto; margin-top: 2rem; margin-bottom: 2rem; padding: 1rem 0.8rem 1rem 1.2rem; color: #3f3b36; border-width: 1px 1px 1px 1rem; border-style: solid; border-color: #f5d995; font-weight: lighter; font-stretch: normal; font-size: 1.2rem; line-height: 2rem; font-family: Monaco, MonacoRegular, monospace; word-wrap: normal; word-break: normal; background-image: url('/wp/wp-content/themes/wire/img/pre.png'); background-attachment: initial; background-size: 1px 4rem; background-origin: initial; background-clip: initial; background-position: 0px -0.9rem; background-repeat: repeat;"><code style="padding: 0px; text-shadow: none; font-size: 1.2rem; font-weight: lighter; font-family: Monaco, MonacoRegular, monospace; line-height: 2rem; background-color: transparent;"><?php
$deny = array("111.111.111", "222.222.222", "333.333.333");
if (in_array ($_SERVER['REMOTE_ADDR'], $deny)) {
header("location: http://www.google.com/");
exit();
<span style="font-family: Monaco, MonacoRegular, monospace; font-size: 1.2rem; font-weight: lighter; line-height: 2rem; color: #3f3b36; background-color: transparent;">} ?></span>
I am not sure where to add this line of code.
Regards
Jay
You can easily block that ip address by contacting your webhost .
You can also try installing
Wordfence plugin for this .
Or you can simply add a rule to block ip address in your .htaccess file in root .