{"id":18426,"date":"2026-09-30T07:33:59","date_gmt":"2026-09-30T04:33:59","guid":{"rendered":"https:\/\/www.hyyat.com\/knowledgebase\/password-protect-directory-cpanel\/"},"modified":"2026-09-30T07:33:59","modified_gmt":"2026-09-30T04:33:59","password":"","slug":"password-protect-directory-cpanel","status":"publish","type":"docs","link":"https:\/\/www.hyyat.com\/en\/knowledgebase\/password-protect-directory-cpanel\/","title":{"rendered":"How to Password Protect a Folder in cPanel (Directory Privacy)"},"content":{"rendered":"<div class=\"hy-tldr\" style=\"background:#f6f7fb;border-left:4px solid #d83954;border-radius:10px;padding:14px 18px;margin:0 0 20px;line-height:1.8\"><strong>In short:<\/strong> To protect a folder on your site with a password: go to cPanel, then Files, then Directory Privacy. Choose the folder, tick Password protect this directory, enter a name for the protected area and click Save, then create a username and password. The browser will then ask for these details before anyone can open the folder.<\/div>\n<p>Directory Privacy adds a login prompt to any folder on your website, for example an admin area, a staging copy or private files.<\/p>\n<p><strong>1.<\/strong> Log in to cPanel (see <a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/how-to-log-in-to-cpanel\/\">how to log in to cPanel<\/a>).<\/p>\n<p><strong>2.<\/strong> In the <strong>Files<\/strong> section, click <strong>Directory Privacy<\/strong>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/hyyathost.com\/images\/2017\/07\/23\/Screenshot-7_23_201710_42_12PM.png\" alt=\"Directory Privacy\" \/><\/p>\n<p><strong>3.<\/strong> Click the folder icon next to public_html (or www) to browse your folders.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/hyyathost.com\/images\/2017\/07\/23\/Screenshot-7_23_201710_43_10PM.png\" alt=\"Browse folders\" \/><\/p>\n<p><strong>4.<\/strong> Click <strong>Edit<\/strong> next to the folder you want to protect.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/hyyathost.com\/images\/2017\/07\/24\/Screenshot-7_23_201710_43_52PM.png\" alt=\"Choose the folder\" \/><\/p>\n<p><strong>5.<\/strong> Tick <strong>Password protect this directory<\/strong>, enter a name for the protected directory and click <strong>Save<\/strong>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/hyyathost.com\/images\/2017\/07\/24\/Screenshot-7_23_201710_47_27PM.png\" alt=\"Protect the directory\" \/><\/p>\n<p><strong>6.<\/strong> Create a user: enter a username and password and click <strong>Save<\/strong>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/hyyathost.com\/images\/2017\/07\/24\/Screenshot-7_23_201710_48_44PM488bc.png\" alt=\"Create a user\" \/><\/p>\n<p>Now, anyone who opens that folder in a browser must enter this username and password.<\/p>\n<p class=\"hy-svc-link\" style=\"background:#fff5f7;border-left:4px solid #d83954;border-radius:10px;padding:14px 18px;margin:20px 0;line-height:1.8\"><strong>Related service:<\/strong> <a href=\"https:\/\/www.hyyat.com\/en\/shared-hosting-2\/\">Hyyat Host shared hosting<\/a> includes cPanel and 24\/7 support.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In short: To protect a folder on your site with a password: go to cPanel, then Files, then Directory Privacy. Choose the folder, tick Password protect this directory, enter a name for the protected area and click Save, then create a username and password. The browser will then ask for these details before anyone can [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"_templately_pack_id":"","_templately_imported_at":"","_templately_source":"","_templately_import_session_id":"","footnotes":""},"doc_category":[2749],"doc_tag":[],"class_list":["post-18426","docs","type-docs","status-publish","hentry","doc_category-website-control-panel-cpanel"],"year_month":"2026-10","word_count":174,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"ahmed fathy","author_nicename":"ahmed-fathy","author_url":"https:\/\/www.hyyat.com\/en\/author\/ahmed-fathy\/"},"doc_category_info":[{"term_name":"Website control panel ( cpanel )","term_url":"https:\/\/www.hyyat.com\/en\/kb\/website-control-panel-cpanel\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs\/18426","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/comments?post=18426"}],"version-history":[{"count":0,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs\/18426\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/media?parent=18426"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/doc_category?post=18426"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/doc_tag?post=18426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}