Basic Authentication puts a username and password prompt in front of your entire site, before WordPress even loads. It is useful for a site that is not ready for the public, such as one still in development or waiting on a launch.
Turn on Basic Authentication
Open your site, then under Hosting select Security.
Switch on Enable Basic Auth.
Enter a Username and Password for the prompt.
Click Save.
Anyone visiting the site now has to enter that username and password before they can see it. Share the details only with the people who need access.
Turning it off
When the site is ready for the public, return to this page, switch off Enable Basic Auth, and click Save.
