w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to logout from wordpress without using wp-login.php?

Just have a page - like wp-logout.php - that runs session_destroy() or better yet, wp_logout() (wp manual)

Albeit, I should offer an alternative to completely disabling that...

You could, for example, have a whitelist of IP's - and in your wp-login.php have:

if(!in_array($_SERVER['REMOTE_ADDR'], explode("
",file_get_contents('whitelist.lst'))){
 header("Location: http://yourpage.com"); exit(); 
}

Alternatively, you could just store the whitelist in an array that comes right before that...

$whitelist = array("123.456.789.100", "98.87.65.54"); //etc





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.