Tag Archives: Wordpress

Blocking your wp-admin log in page from strangers..

######Redirect strangers away from the page#######

  $client = $_SERVER['REMOTE_ADDR'];
  $reg = "/192\.168\.10\.*/";
  $home = `printf $(cat /location to where you can get your WANIP/)`;

  if (preg_match($reg, $client))
   {
        echo "";
   }
  elseif (mb_ereg($home, $client))
   {
        echo "";
   }
  else
   {
     header("Location: http://yoursite");
   }

Wanting to cut off access from strangers to my wp-admin login page, I spent a night toiling around with a few possible solutions, while repairing a laptop for a client, whom was quite computer illiterate. I would consider myself illiterate in the sense of programming in assembly language. Ergo, at some level, in all things we are ignorant, which is the deviated point I’m trying to establish. Sorry to meander..

Considering the fact that if you don’t have SSL setup on your server , and even if you do, you still are susceptible to MITM attacks via programs like Ettercap-ng, in certain scenarios. (i.e. Malicious networks) So for my own sense of peace, decided to block of access to the rest of the world to my wp-admin page. You might be able to still access it if you can modify your HTTP requests to make yourself look like me….

If you want to use this, I put this piece of code at about line 25, and I would test it from different proxies just to be safe. More info and tutorials to come.

Let me know if you have any questions, comments or concerns.