Support 24/7 Service status
Hosting
Email
Discounts
Help
Company
Sign in Support 24/7
Get started

Password-protecting a folder or a whole site

Ask for a username and password before anyone can see a folder or your whole site, useful for a site that's still being built, a staging copy or private files.

Updated 17 November 2026

You can make the browser ask for a username and password before showing a folder, or your whole site. It's handy for a site you're still building, a staging copy, or files only a few people should see.

Protect a folder

  1. Open DirectAdmin from your service page (one-click login).
  2. Go to Advanced Features → Password Protected Directories.
  3. Choose the folder. To protect the whole site, choose public_html for your domain.
  4. Turn protection on, enter a name for the prompt (like "Private"), and add a username and password. Then Save.

Open the address in a private browser window to check: the browser should ask for the username and password.

To let more people in, add a user for each one, so you can remove a person later without changing everyone's password. To remove protection, untick it on the same page.

Good to know

  • It's a simple lock. It keeps casual visitors and search engines out. Use a strong password, but don't rely on it alone for sensitive data.
  • Search engines can't see protected pages. Remember to remove protection when your site goes live.
  • WordPress: protecting the whole site also protects the login page and the admin area, which is a useful extra layer while you're building. Some plugins and services need to reach your site from outside (payments, uptime monitors), so they may stop working while it's protected.
  • Only a few pages? WordPress can password-protect a single post or page itself: open it, and under Visibility choose Password protected.

Questions? Open a ticket.

Still stuck?

Open a ticket and a real person will help you, any time of day.

Open a ticket Other ways to reach us

Ready to go live?

Pick a plan in a minute and your site's ready shortly after.

Get started