WP-Login Tweak to Stop Unauthorized Access and Keep Hackers Out
-
Would love some feedback on this tweak that disallows general access to the login.php page. It requires that a PIN be passed to the login page. No PIN, no access, goodbye. Sick of the bad guys pounding on my websites.
// WordPress Tweak - Stop Unauthorized Access - Keep Hackers Out // Author: email redacted - rev 11.30.15 // 1) Add this snippet to the top of the WordPress wp-login.php file, right after the bootstrap line. // 2) Create a PIN and update the constant // 3) Pass the PIN thru the login URL in order to access the page: /wp-login.php?eePIN=xxxx // ... Otherwise you get redirect away and never see the login form. So long bad guys... // The page access PIN define('eePIN', 'xxxxx'); // Set to whatever your heart desires. // The Redirect URL define ('eeAWAY', 'https://elementengage.com/welcome-hackers/'); // Same same, but you can leave it like this. if(@$_POST['log'] OR (@$_GET['action'] == 'logout' AND check_admin_referer('log-out'))) { // Login or Logout // Proceed normally } elseif(@$_GET['loggedout']) { // Logged out header('Location: https://' . $_SERVER['HTTP_HOST']); exit; } else { // This PIN must be passed in order to access this page $thePIN = @$_GET['eePIN']; if($thePIN != eePIN) { header('Location: ' . $eeAway); exit; } }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘WP-Login Tweak to Stop Unauthorized Access and Keep Hackers Out’ is closed to new replies.