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.

  • Log in to cPanel.
  • Click Directory Privacy.
  • A list of the directories on your account will now show.
  • Select the directory you wish to limit access to.
  • Tick Password protect this directory checkbox.
  • 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.)
  • Click Save.
  • Click Go Back

Tip: To password protect your entire website select public_html.

Creating a User

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

Removing a User

To delete a user from the protected directory list;

  • Select the user name from the Authorized Users list.
  • 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;

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