毕竟用wordpress的人实在是太多了,为了安全,有时候不得不修改一些默认的设置来简单的强化一下它的安全性。
如果用插件之类的,毕竟会有些臃肿,且安全性比较低,可以用代码来实现的,还是用代码来实现吧。
文章目录
方法 一:
//修改WordPress后台登录地址:
add_action('login_enqueue_scripts','login_protection');
function login_protection(){
if($_GET['hello'] != 'world')header('Location: /');
}
//修改后的登陆地址为(如果登陆地址不正确就跳到到首页)
http://www.xxxx.com/wp-login.php?hello=world
方法二:
首先找到wordpress根目录下的wp-login.php 搜索wp_shake_js找到下方代码:
if ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) )
add_action( 'login_head', 'wp_shake_js', 12 );
//在这段后面加入代码:
if($_GET["aa"] !="bb"){header('Location:/404');}
//后台地址就变成了:
/wp-login.php?aa=bb
看,是不是很简单?!
具体根据自己的喜好去微调。









![Mysql innodb 系统表损坏带来的问题[Warning] InnoDB: Cannot open table XXX/wp_downloads from the internal data dictionary of InnoDB though the .frm file for the table exists. 终极解决办法](https://nrcs.xyz/wp-content/themes/begin/prune.php?src=https://nrcs.xyz/wp-content/uploads/2023/09/e4165-2023-09-28_102533.png&w=280&h=210&a=&zc=1)

评论