You can require a username and password to view a folder on your website, for example a staging area or a private downloads page.
- In cPanel, open Directory Privacy in the Files section.
- Click the folder name to navigate to it, then click Edit beside the folder you want to protect.
- Tick Password protect this directory, enter a name for the protected area and click Save.
- Click Go Back, then under Create User enter a username and password and click Save.
Visitors will now see a login prompt. You can add several users, and remove them from the list on the same page.
Protecting your WordPress wp-admin folder this way can cause problems with some plugins and AJAX features; use a security plugin instead.