WordPress

How to add Password Protection on a Directory in cPanel? | WordPress

How to add Password Protection on a Directory in cPanel? | WordPress

Sometimes, we all feel to add some extra layer of security in our cPanel account by adding Password protection in files/folders. Adding Password Protection in Folder/files can be easily done in cPanel as it provides the option to lock the files and folder using a custom password and only can be accessed if you know the password. So, In this guide, I am going to show you how to add Password Protection on a Directory in CPanel.

How does Password Protection work in cPanel?

When we choose to add password protection on a directory in cPanel, cPanel creates a rule in your .htaccess file. This rule specifies that the folder is protected and the visitor will need to provide the proper username and password to log in and view the files within it.

More Article Like this:

Solution: 403 Forbidden error? Try these Steps | WordPress Errors

How to take the Backup of your WordPress website easily?

How to Add Password Protection on a Directory or a Folder in cPanel?

Follow the steps given below:

Step 1: Log into your cPanel.

Add Password Protection to a folder/directory

Step 2: Go to the Files section and click on the Directory Privacy option.

Directory Privacy| Lock a folder with password in cPanel | Directory Password Protection

Step 3: Select the directory you want to add password protection and then you will see the Set permissions for “/home/example/directory/” screen appears.

enable password protection for a folder in cPanel |

Step 4: Select the checkbox labeled “Password protect this directory:“.

 Enter a name for Protected directory

Step 5: Type a name for the folder you are trying to add password protection in the field labeled “Enter a name for the protected directory:“.

Step 6: Click on the Save button to save the name you have entered for the directory and option to password protect the directory.

 Create Username and Password protection

Step 7: Click Save button to save the credentials that you have entered.

How to Remove Password Protection on a Directory in cPanel?

The steps given below to remove password protection on a directory are easy to follow and simple to understand. One reason you might want to password protect a directory and then remove the protection is for testing purposes. Or, if you want to make the folder/Directory open to the public, then you can remove the password protection so that everyone can access the files in the directory/folder.

Follow the steps given below:

Step 1: Log into your cPanel.

Step 2: Scroll down to the Files area in your cPanel account and then click the Directory Privacy option.

Step 3: Select the directory from the list of folders that you want to remove password protection. The directory should appear with a lock-in front of it if it is currently password protected.

Step 4: Uncheck the box which says “Password protect this directory“.

Step 5: Finally, click the Save button.

One comment

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.