Cloud Service >> Knowledgebase >> WordPress >> How to Add a Password to WordPress Admin (wp-admin) Directory via cPanel?
submit query

Cut Hosting Costs! Submit Query Today!

How to Add a Password to WordPress Admin (wp-admin) Directory via cPanel?

Adding a password to the WordPress admin (wp-admin) folder is another good way to strengthen your site security. This technique restricts access to the admin area so only authorized persons can access the section. Here is a detailed manual on executing this procedure with cPanel.

 

Understanding the Importance of Password Protection

 

The attackers tend to attempt browsing to the wp-admin location to guess passwords, most probably through brute force. The chances of different unauthorized accesses can be brought down considerably by including a password layer, which is particularly important for sites that work with sensitive information or have millions of users.

 

Steps to Add Password Protection via cPanel

 

Step 1: Log into cPanel

  1. Sign in to your cPanel through your web hosting account.

  2. Search for the icon labelled "File Manager", which enables you to oversee your website files.

 

Step 2: Navigate to the wp-admin Directory

  1. Find the leading Directory for your WordPress installation in File Manager. This is often named public_html or may be a subfolder if you installed WordPress in a specific directory.

  2. Open the wp-admin folder by double-clicking it.

 

Step 3: Create a Password Protection

  1. Search for the "Settings" option in the top right corner of the File Manager and check the box for "Show Hidden Files".

  2. When you are in the wp-admin folder, search for the option labelled "Directory Privacy" or "Password Protect Directories" (the name might differ depending on your cPanel version).

  3. Select the wp-admin Directory and click on "Save".

 

Step 4: Configure Password Protection

  1. You will see an option to "Password protect this directory". Check this option.

  2. Input a name into the "Authentication Name" field for the secure Directory (visible to users during login for username and password).

  3. Afterwards, generate a username and password for entry. Ensure you select a robust password incorporating letters, numbers, and special characters.

  4. After entering the username and password, click "Add/Modify Authorized User" to save the settings.

 

Step 5: Test the Password Protection

  1. Start a new browser tab, go into private browsing mode, and go to your WordPress admin link (e.g., yourdomain.com/wp-admin).

  2. You will be asked to input your recently made username and password. If you are also lucky enough to bypass this by logging in, this confirms that password protection is working.

 

Troubleshooting Common Issues

 

If you decide to turn on password protection, you can get prohibited issues, including a 404 error or 'Too many redirects' message. To resolve this:

 

  • Access your WordPress root directory through the File Manager.

  • Locate the .htaccess file. If you can't see it, make sure to show hidden files.

  • Make changes to the .htaccess file by including the specified line at the conclusion:

 

ErrorDocument 401 default

 

This line helps manage error responses when unauthorized access is attempted.

 

Additional Security Measures

While adding password protection is a significant step, consider implementing further security measures:

 

  • Two-Factor Authentication: This raises security since it is necessary to verify your identity using another form of identification, such as through a code on your phone.

  • Strong Passwords: Ensure that the password you use for your WordPress site, the database, and the FTP is secure and different. 

  • Disable Directory Browsing: To avoid hackers seeing the contents of your Directory, you should incorporate this line—htaccess file.

 

Options -Indexes

 

  • Disable PHP File Execution: Prevent malicious scripts by turning off PHP execution in specific directories such as wp-content/uploads.

 

Conclusion

 

Enabling password protection for your WordPress admin folder through cPanel is a simple procedure that dramatically improves your website's safety. By implementing the steps described, you can limit entry to your admin section, making it harder for unauthorized individuals to breach your site. Always remember to integrate this technique with additional security measures to establish a strong defence against possible dangers.

 

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!