Learn how to limit access to areas of your website using Directory Privacy in cPanel. Password protection restricts access to folders in your account by asking a visitor to enter a username and password.

How to password protect a directory in cPanel

Follow these steps to password protect a directory, or website using Directory Privacy in cPanel.

  1. Log in to cPanel.
  2. Click Directory Privacy.
  3. A list of the directories on your account will now show.
  4. Select the directory you wish to limit access to.
  5. Tick Password protect this directory checkbox.
  6. Enter a name to the password protected directory. (This is the name visitors will see. It can appear as anything, no matter what the directory is called.)
  7. Click Save.
  8. Click Go Back

Tip: To password protect your entire website select public_html.

Creating a User

  1. Complete the Username, Password, and Confirm Passsword fields.
  2. Click Save.

Removing a User

To delete a user from the protected directory list;

  1. Select the user name from the Authorized Users list.
  2. Click Delete User.

Removing Password Protection

If you no longer wish to limit access to a directory you can remove the login prompt following these steps;

  1. Log in to cPanel.
  2. Click Directory Privacy.
  3. A list of the directories on your account will now show.
  4. Select the directory you wish to remove password protection from. Indicated with a padlock icon.
  5. Untick Password protect this directory.
  6. Click Save.