Home › Forums › WordPress › IP address restriction on website
Tagged: Core PHP, IP address, IP Restricted, IP Restriction
This topic contains 1 reply, has 2 voices, and was last updated by admin 2 years ago.
Hi I am running a wordpress website and I want to move all other IP address to unathorized page, when they visit on my website from different IP address.
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
Mail (will not be published) (required):
Enter the destination URL
Or link to existing content