JAYbranding

How to Secure WordPress wp-login - Detailed Guide

Securing WordPress against cyberattacks is a major concern. Due to the popularity of WordPress, you can clearly observe numerous attacks targeting your wp-admin page with the goal of taking over admin privileges and installing malware. To prevent this, several essential measures need to be implemented to ensure optimal system security: - Back up WordPress regularly, daily or weekly, so you can restore a backup when needed (since once infected with malware, it is very difficult to clean and separate the source code) - Install a plugin to hide the login page: https://wordpress.org/plugins/wps-hide-login/ - Set up 2FA (two-factor authentication) for secure login via Wordfence - Block wp-admin access via .htaccess Below are the details of the items mentioned above:

1- Back up your website

Back up your website regularly using the backup feature on your hosting, or you can use FTP to back up your source code and database daily. Contact your WordPress hosting provider to purchase or use this feature (JAYbranding includes a complimentary daily backup feature for the most recent 7 days).

2- Install WPS Hide Login

By default, on a WordPress site, when you type yourdomain.com/wp-admin or yourdomain.com/wp-login.php, it automatically redirects to the login page. With this default setup, automated software often uses brute-force attacks—for example, repeatedly entering the username admin / 123456 and other easily guessed passwords—until a match allows them to log in. Hiding the login page is the most basic measure, but at least it limits random automated bot attacks. To do this, after installing the WPS Hide Login plugin, go to Settings and change the default login URL to your desired path. You should add a random string of characters to increase security, for example: loginmxjfei328 If you forget this URL string, you can simply delete the plugin to restore the website to normal.

3- Set up Two-Factor Authentication via the Wordfence plugin

After installing the Wordfence plugin https://vi.wordpress.org/plugins/wordfence/, go to Login Security \ select the Two Factor Authen tab. Then, use any mobile app such as Authy or Google Authenticator and scan the image displayed on your screen. From then on, every time you log in, it will require an additional code retrieved from your phone.

4- Lock the folder via .htaccess

This method is only applicable for those with coding knowledge and is nearly the highest level of security lock, making it the hardest to hack for both bots and hackers. It locks access by displaying a username / password prompt for users to enter; incorrect entries will deny access. &nbsp; Step 1: Go to Htpasswd Generator and generate a random username / password for .htaccess. Then, click Create .htpasswd file. This tool will automatically generate a .htpasswd file: Step 2: Save the file above as “.htpasswd” and upload it to the root directory of WordPress. You can use Notepad to create the file: Step 3: Add the following code snippet to the existing .htaccess file on the server (in the root directory): <code># Stop Apache from serving .ht* files &lt;Files ~ "^.ht"&gt; Order allow,deny Deny from all &lt;/Files&gt;</code> <code># Protect wp-login &lt;Files wp-login.php&gt; AuthUserFile ~/.htpasswd AuthName "Private access" AuthType Basic require user yourusername &lt;/Files&gt;</code> Remember to replace yourusername with the username in the .htpasswd file. <blockquote>With that, you have finished enabling WordPress security on your hosting. At JAYbranding, we pre-integrate these protections for you so businesses can focus on content development rather than worrying about website security.</blockquote>