Skip to content

How to password protect a directory in cPanel?

Updated 1 min read

Updated: 28 September 2026 · Applies to: cPanel & WHM 138 (Jupiter theme)

Directory Privacy (called Password Protect Directories in older cPanel) asks visitors for a username and password before they can open a folder of your website.

Protect a folder

  1. Log in to cPanel (for example at https://yourdomain.com:2083, or from the Ucartz client area).
  2. Open Files › Directory Privacy.
  3. Click folder names to reach the folder, then click Edit next to it.
  4. Tick Password protect this directory, enter a name for the protected area (visitors see it in the login prompt) and click Save.
  5. Click Go Back. Under Create User, enter a username and a strong password and click Save.

Add a user for each person who needs access. Protection covers the folder and all its subfolders.

Note: Protecting wp-admin this way can break some WordPress features that call admin-ajax.php. Test your site after turning it on.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Linux server management

hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.

Was this answer helpful?

Still stuck? Open a ticket