0

Is there a way to restrict access to certain IP address for a specific page in WordPress? Can't find any resource online for this issue.

Say my site is example.com and I have a page example.com/free/ which only certain IP address can access. Other pages should be available to public.

1 Answers1

0

you can create a Wordpress(MU) must-use plugin.

in the plugin :

$request_uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
if ($request_uri === '/free') {
  if(ip_address_allowed){
  }
  else{
    //redirect to where -ever
  }
}
Div
  • 63
  • 2
  • 10