Password protect your entire WordPress site, posts, and categories
How to password protect a whole WordPress site with a plugin, lock individual posts and pages in the block editor, and restrict categories when you need gated content.
How to password protect a whole WordPress site with a plugin, lock individual posts and pages in the block editor, and restrict categories when you need gated content.
Sometimes a site should not be public yet: a staging build, a client preview, a members-only area, or a draft section you are not ready to share. WordPress can password-protect the whole site, a single post or page, or (with a plugin) an entire category.
This is access control for visitors, not a full security stack. Site-wide password gates do not replace login security, two-factor authentication, updates, or backups. Use them when you need a simple shared secret in front of content.
For a whole-site gate, use a dedicated plugin. A common option is Password Protected by Ben Huson. It asks visitors for one site password before they see WordPress-generated content.
Typical features:
Important limit: the plugin protects content WordPress serves. Direct file URLs (for example an image path under wp-content/uploads/) may still open if someone has the link. Treat it as a soft gate for browsing, not file-level ACLs.
Visitors who are not exempted will see the password form before the rest of the site.
Alternatives in the plugin directory include:
Pick one maintained plugin, keep it updated, and remove it when the site goes fully public. For staging, many hosts also offer HTTP Basic Auth or IP allowlists at the server level. That sits in front of WordPress and can be cleaner for private previews than a site-wide content password.
You do not need a plugin to lock one post or page. WordPress includes this in the editor.
Older screenshots still show the classic editor’s Visibility → Edit control. In the block editor the same setting lives in the document sidebar. Behavior is unchanged: visitors see a password form instead of the content until they enter the correct password.
Private (not password-protected) is different. Private posts are only visible to logged-in users with the right role. Password-protected content is for sharing a secret with people who do not need accounts.
This pairs well with least privilege for staff accounts: share a content password when you must, keep admin logins on MFA.
WordPress does not password-protect categories by default. You need a plugin that gates category archives and the posts inside them.
One example is Access Category Password. It replaces protected category content with a password form and can adjust feeds so full post text does not leak.
Typical setup:
Plugin UIs change over time. If a plugin is abandoned, switch to a maintained membership or restriction plugin rather than running unmaintained code. That is basic security hardening.
/wp-login.php. Follow the login security guide for that.Use a whole-site plugin when the entire front end should be gated. Use the block editor’s password visibility for one-off posts and pages. Use a category plugin when a whole section needs the same secret. Keep plugins updated, prefer strong unique passwords, and put real admin protection on MFA and hardening rather than on a visitor password form alone.
Found this useful? Share it.