Knowledge Base

How to Make Your WordPress Website Secure

This post outlines a number of strategies to improve your WordPress website's security.

Crucial security precautions for WordPress

You should take a few crucial actions to improve a WordPress website's security.

Robust WordPress Passwords

All administrator accounts should have strong passwords, and passwords should be changed on a regular basis. Strong passwords are difficult to figure out. A brute force assault is used by hackers to access accounts with strong passwords. The section below discusses how to prevent brute force assaults.

A distinct username for WordPress

Avoid using the adminstrator's default admin username. The default admin administrator should be deleted once a user with a different username is created and given the administrative role.

Update WordPress, Themes, and Plugins

Regular updates are made to WordPress to fix identified vulnerabilities. Using outdated WordPress versions makes it simple for hackers to access your website. Make sure WordPress and its associated plugins are up to date by doing updates on a regular basis.

Remove WordPress Plugins and Themes That Aren't Being Used

That code is still accessible online and may be a target for hackers even if unneeded plugins and themes are removed. To lessen the chance that hackers will be able to access your website, be sure to remove any unneeded themes or plugins.

Frequent backups

Backup your WordPress website on a regular basis. Backups assist bring a site back online fast in the event of a compromise, but they cannot stop a site from being compromised. Softaculous offers a single, easy-to-use interface for backing up, restoring, and updating WordPress websites.

Protecting against brute force attacks on WordPress

A user or software tries to access a website by repeatedly guessing various username and password combinations in a brute force assault, which is a simple kind of attack. Brute force assaults are frequently successful because, regrettably, many people have readily known login and password combinations.

You can see that your WordPress website reacts slowly or not at all if it is subjected to a brute force attack. You could also have trouble logging in. This is because a brute force assault generates a large number of PHP and MySQL calls due to the deluge of login attempts. The performance of websites is negatively impacted by these calls, which also raise server load.

Method 1: Secure the WordPress login page using a password

The wp-login.php file is used by WordPress for logins. You may further secure your website by encrypting this file with a password. Before users can even access the wp-login.php file to log in to WordPress, they need to input their username and password.

Use these procedures to secure the WordPress login page with a password:

  1. Go to http://www.htaccesstools.com/htpasswd-generator on your web browser.
  2. Enter your username in the Username text box.
  3. Enter the user's password in the Password text box.
  4. After selecting "Create.htpasswd file," copy the line of text. The username you entered should appear in the line of text, followed by
    a colon (:) and the encrypted password. For instance:
username:$apr1$IUQgDA6U$qbXb9wEnjirNCqxezpjoe5
  1. In the home directory of your hostingws account (/home/username, where username is your hostingws account username), create a file called.wp-password. Copy and paste the preceding step's line of text into the file. This file can be created and edited in two ways:

    • Open a text editor from the command line after logging into your account via SSH.
    • Use an editor in the File Manager after logging into your account using cPanel.
  2. Close the text editor and save the.wp-password file.
  3. In the directory where WordPress was installed, create a.htaccess file:

    • This directory is /home/username/public_html if you installed WordPress in the document root of the domain, where username is the username associated with your hostingws account.

    • This directory, where directory denotes the WordPress location, is /home/username/public_html/directory if you installed WordPress in a subfolder or subdomain.
  4. Copy and paste the following text into the .htaccess file:
    
    # Prevent Apache from serving .ht* files:
    <FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    </FilesMatch>

ErrorDocument 401 "401 Unauthorized"
ErrorDocument 403 "403 Forbidden"

Protect wp-login.php:

AuthUserFile /home/A2-USERNAME/.wp-password AuthName "Please log in" AuthType Basic require user WP-USERNAME

9. Make the following modifications to the.htaccess file:
  - Enter your hostingws account (cPanel) login in lieu of hostingws.
  - Enter the username you provided in step 2 in lieu of WP-USERNAME.
10. Close the text editor and save the.htaccess file.
11. To access the WordPress login page, use your web browser (for instance, http://www.example.com/wp-admin, where example.com is your domain name).
12. You ought to be asked to enter your password and login. Enter the login credentials you provided in stages two and three. You may now log in to WordPress as usual when the WordPress login screen has appeared.
Please rate this article to help us improve our Knowledge Base.

0 0