在你当前主题的 functions.php 文件中,在末尾处添加以下代码
//保护后台登录
add_action('login_enqueue_scripts','login_protection');
function login_protection(){
if($_GET['word'] != 'press')header('Location: http://yoursite/');
}
上面的word、press可以自己修改,
http://yoursite/ 就是你的域名或者ip
然后不管别人是直接访问你的 http://yoursite/wp-admin 还是 http://yoursite/wp-login.php, 都会直接定向到你的 http://yoursite 去
登录网址就变为:http://yoursite/wp-login.php?word=press