prsona
Get started

Password protect a staging site: anyone with the address can open it

Last reviewed

Anyone with the address can open your staging site.

Password-protecting a staging site means a visitor must enter a username and password before any page loads. The most dependable way is HTTP basic authentication, the plain login box the browser itself shows, which many hosts can switch on from their control panel. A plugin that hides the site behind its own login page also works on most sites. Either one keeps the public and search engines away from unfinished work.

Why an unprotected staging site costs you customers

An open staging copy is a public preview of work nobody has approved. Customers can stumble on unfinished pages and draft prices, competitors can see a redesign early, and search engines can list it beside the real site. Test forms on an open copy also attract spam, which buries the genuine test messages your developer is waiting for.

What usually causes an unprotected staging site

  • The host created the staging copy with protection off by default
  • The password was removed so the client could review without a login, and never put back
  • The copy lives on a subdomain the developer set up by hand, with no protection added
  • A coming-soon plugin was used, but it lets search engines or logged-out visitors reach some pages
  • Protection covers the homepage only, leaving inner pages and uploaded files open

How to check for an unprotected staging site yourself

  1. Open the staging address in a private browser window, where you are not logged in. A login box or password page should appear before anything else.
  2. Try an inner page as well, such as /contact or /about on the staging address. It should ask for the same password.
  3. Look at where the login comes from. A small plain box drawn by the browser is basic authentication; a styled page with your logo comes from a plugin or the host.
  4. Ask your developer which method protects staging: the host's setting, basic authentication on the server, or a plugin. Each one is changed in a different place.

How to fix an unprotected staging site

  1. Use the host's built-in protection first. Several managed hosts have a password protection switch for staging copies or individual environments in their dashboard, which is usually the quickest route.
  2. If there is no switch, have your developer add HTTP basic authentication on the server, through a control panel option often called directory privacy or password-protected directories, or in the server configuration. It covers every page and file, not only the pages WordPress serves.
  3. On WordPress, a private-site or maintenance plugin can require a login for every page as a lighter alternative. Confirm it blocks logged-out visitors everywhere, not only on the homepage.
  4. Use a staging password that differs from every live password, and change it when someone leaves the project.
  5. Serve the staging copy over https only, because the browser sends the username and password with each request and https keeps them encrypted.
  6. If an outside service needs to audit the copy, give it the staging login or let its checker through the firewall rather than taking the password off.

How Prsona catches an unprotected staging site

With the Staging add-on, a staging copy that search engines can reach and index is raised as a finding. For a protected copy, an admin can save its basic authentication login, stored encrypted and only sent to that site over https, or let PrsonaBot through the firewall instead.

Prsona looks for an unprotected staging site as part of a staging site audit.

Have a password-protected staging site audited without taking the password off.

Questions about an unprotected staging site

Is HTTP basic authentication secure enough for a staging site?

For keeping the public and search engines out, yes, as long as the site uses https. Basic authentication sends the login with every request in a form that is easy to decode, so over plain http it can be read in transit. Over https it is encrypted, and it protects every page and file.

Will a password on staging stop outside services from checking it?

Not if you plan for it. Your team logs in once per browser session. A monitoring or testing service that needs to see the copy can be given the staging login, or allowed through by your firewall, so the password can stay on throughout.

Sources