WordPress Login Brute Force Attack Print

  • 0

How to Password Protect the wp-login.php File

There are two (2) steps in accomplishing this:

  • First, you need to define a password in the .wpadmin file.
    create the file in your main directory then put the username and encrypted password inside the .wpadmin file, using the format username:encryptedpassword

    EXAMPLE: john:n5MfEoHOIQkKg

    password encrypted website link: https://hostingcanada.org/htpasswd-generator/

  • upload below code in .htaccess file-

ErrorDocument 401 "Unauthorized Access"
ErrorDocument 403 "Forbidden"
<FilesMatch "wp-login.php">
AuthName "Authorized Only"
AuthType Basic
AuthUserFile /home/username/.wpadmin
require valid-user
</FilesMatch>

 


Was this answer helpful?

« Back