How to hide the default WP-admin?

2019-06-0119:52:36 评论

As we know, the wp-admin is the default entrance of your wordpress site, obviously if you do not hide it, the others can easily knock the door which means it's at least not that comfortable. Then what can we do ? Just like this as below:

Step 1: in Xftp,find the file "functions.php" in /home/wwwroot/ theme", download it and make a copy. Open it with tools such as Notepad++

Note: please replace the "" 、“example theme" with your own ones.

Step 2: add these codes to the end of the "functions.php" and save it.

 * try to protect the wp-admin


function login_protection(){  

   if($_GET['knock'] != 'the door')header('Location:');  


Step 3: upload the new "functions.php" to its original place and replace the old one, now you can only visit the wp-admin by the address " door", of course the others can not guess it easily.

Note: please replace the "knock" 、"the door" 、"" with what you like.



:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: