Password-protect a folder
A folder password asks visitors for a username and password before they can open a folder. Use it to hide a site under construction, or files meant for one client.
Important: This protects against casual visitors. It is not a substitute for application security, and files in the folder remain unprotected if someone knows a direct link that bypasses the folder, such as through another domain.
Protect a folder
- Open Account → Hosting → your site → Files. Under Folder and server rules, click Manage.
- Under Folder settings, type the folder, such as
public_html/clients, and click Show. - Find Password protection.
- Enter a Name shown at sign-in, for example
Client area. - Click Turn on.
- Add a Username and a strong Password, then click Add user.
Visit the folder in a private browser window. You should see a sign-in box.
Add or remove a user
Return to the folder's settings in Files. Add a user, or click Remove next to one to delete it. Click Turn off to remove protection.
Protecting WordPress staging
If you set up a staging site, protect its folder here so search engines and visitors can't find the draft. Also keep search engines out of the staging copy from WordPress, under Settings → Reading.
If something goes wrong
- Prompt keeps reappearing: the password is wrong, or you changed it. Reset the user.
- WordPress rejects the login prompt on admin-ajax: some plugins call a file inside the protected folder. Protect a subfolder instead of the site root.
- Everything shows a 500 error: the generated
.htaccessconflicts with your other rules. Remove protection, then reapply. See .htaccess basics.
Still stuck? Ask us and we'll walk you through it.
