Home › Forums › WordPress › IP address restriction on website › Reply To: IP address restriction on website
First you have to create an array of ip address which you want to allow to access website.
Ex : $ip_array = array(“ip_address1”, “ip_address2”, “ip_address3”);
Now you have to get the client ip address :
$client_ip = $_SERVER[‘REMOTE_ADDR’];
After that you have to check if client ip address exists in your ip address array or not
// Allowed to access
// Not allowed to access