How to Secure WordPress Login : Easy Steps

Secure WordPress Login
This article will help you know how to secure a WordPress login using password-protect in the WordPress login file.

Nowadays, hackers seem more interested in attacking WordPress sites. So here is a fast and easy method to prevent WordPress brute force attacks.

We are going to password protect our WordPress login file. Please follow the below steps to secure WordPress login.

1) Open your Apache main configuration file and add the following.

vi httpd.conf
<FilesMatch "wp-login.php">
AuthName "Please Authorize to Continue"
AuthType Basic
AuthUserFile /root/.htpasswd
require valid-user

 

Note: If you are using any other CMS, please find the login file and add that file in the “FileMatch” section.

 

2) Set up authentication

Create a password file with the user name “auth-usr”.

htpasswd -c /root/.htpasswd auth-usr

 

( You can also use this .htpasswd generator tool if you don’t like the command line way: http://www.htaccesstools.com/htpasswd-generator )

 

3) Restart Apache to update these changes.

/etc/init.d/httpd restart

 

Done!! Now you need to provide this user name and password to access your login pages. It will work with all your WordPress sites—no need to create separate .htaccess files.

If you don’t have root access to the server or if you are on a shared environment, then you can add these same codes to your .htaccess file ( create one if you don’t have one already ) and create a .htpasswd file using http://www.htaccesstools.com/htpasswd-generator/ and put it under your document root. ( Also make sure to change the AuthUserFile path )

 

So this is how you secure the WordPress Login page.

Share this post

Have you explored our ALL-IN-ONE WordPress Care Plan?

Discover the convenience of one plan that caters to all your WordPress maintenance requirements.

Interested in reselling our plans? Explore our White Label WordPress Agency Plan!

Ideal for those interested in reselling our plans with their own branding, fully white-label!

Are you looking for a one-time WordPress fix? Explore our Heal WordPress Plan!

24/7 Assistance from Our Expert WordPress Team. Swiftly resolve issues and get your WordPress site fixed in no time!

WPHealers uses cookies.