Sign inBlogSupportContact
Security

Password protect your entire WordPress site

One command locks the frontend behind a password wall. Logged-in users bypass it automatically.

4 min read May 2026 password protect

Your staging site is live. Anyone can see it.

You're building a client site. It's on a live URL — staging.clientsite.com or a temporary domain. The design isn't done, the content is placeholder, but the URL is accessible to anyone who stumbles on it. Google might index it. A competitor might find it. The client might share the link before you're ready.

WordPress doesn't have a built-in "lock the whole site" feature. Individual posts can be password-protected, but there's no site-wide toggle.

What most people do instead

Password protection pluginsInstall a plugin, configure settings, pick a password. Works, but adds a plugin for a feature you'll disable in two weeks.
.htaccess passwordServer-level auth via .htpasswd. Requires FTP access, blocks everything including wp-admin, breaks AJAX calls.
Hope nobody finds itNo robots.txt, no password, no protection. Fine until Google indexes your half-built site.

A better way: one command, site locked

Open the navigator. Type password protect -password=clientpreview. Hit enter. Every frontend page now shows a password wall. Logged-in admins bypass it automatically. wp-admin, REST API, AJAX, and cron all continue working.

TrueCommander
Password protection enabled
Password ProtectionActive
StatusEnabled
ScopeAll frontend pages
BypassLogged-in users, wp-admin, REST API, AJAX, cron

Admins never see the wall. Logged-in users, wp-admin, REST API, AJAX, cron, and login pages all bypass protection automatically. Only anonymous visitors see the password form.

How it works

1
Set a passwordpassword protect -password=yourpassword enables the wall. Auto-registers as a startup command so it persists across page loads.
2
Visitors see a password formA branded password page intercepts every frontend request. Correct password sets a session cookie.
3
Disable when readyRemove the startup command entry or delete it from the Startup Commands module. Site is instantly public again.
DetailValue
Command namepassword protect
Set password-password=yourpassword
ScopeAll frontend pages
BypassesLogged-in users, wp-admin, REST API, AJAX, cron, login page
Auth methodCookie-based session after correct password entry
Can be used in

Real example

You're building a WooCommerce store for a client. The site is on a temporary domain while development is in progress. The client wants to preview progress, but you don't want the public seeing an unfinished store with placeholder products and broken layouts.

You open the navigator and set a password. You send the client the URL and the password. They can browse the full site. Everyone else sees a password form. Google can't index it. Competitors can't screenshot it.

Two weeks later, the site is ready to launch. You remove the startup command entry. The password wall disappears instantly. The site is live.

Goes further with TrueCommander

Ready?

Lock your site in one command.

This is one of 91 commands. All included with every license.

Cookies. The short version.

Essential cookies keep the cart and theme working. Analytics only fire if you say yes. Read our policy.