How to Hide Password Protected Posts from WordPress Loop. Why put a password on the page?

The implications of this are manifold in the functionality of WordPress, like providing content for team members or offering partner content/clients that is dedicated to them. This is also a way of providing access to sensitive content. Nevertheless, WordPress functionality defaults in this area are quite limited. That's why there are plugins.

In this article we will see 8 of these plugins that make it easy to add effective system password protection on .

1. Woocommerce Password protected products, categories or store

You can also choose to display password-protected pages in search results, allowing search engines analyze these pages.

Its features include: password protection for a section or your entire site, the ability to create multiple passwords by importing them to create different rules access to your site, customize the background of the password protection page and much more.

2. Google Authenticator 5-Step Login Security

This WordPress plugin allows you to create a temporary one-time password generated by your phone. This way, even if someone knows your password, remembers it, or steals it, they won't be able to log into your account.

Its main features are: a two-step connection process that adds additional protection your website, no fees for SMS messages, no hacking of your account without your phone, ability to enable or disable authentication in two easy to use GUI user experience, fast and professional customer support, detailed documentation and much more.

3. Block double logins

The Double Logins Block WordPress plugin allows your site to block the connection through a shared account. The user will not be able to connect to your site in two different places.

4. Allow single user login

This WordPress plugin works in the same way as the Word Lock Block Double Logins plugin. This also allows you to block simultaneous connection to your site using account several times. This blocks ID sharing.

Its functions include preventing sharing credentials by users, blocking users who want to connect from a similar IP address, ease of use and much more.

5. Super Shapes

This is an add-on to the plugin Super shape whereby you can password protect your forms on your WordPress site. You will also be able to hide the form for non-registered users, as well as for certain user roles.

This is an easy module to use and is compatible with most popular browsers. He is also fully responsive!

6. Product password protection

This plugin is simple enough that it can be used to activate password protection for your products (general or individual for each product). Thus, if an administrator provides password protection for certain products, then the user will be prompted to enter the product password to purchase it.

Its features are: ease of use via toolbar, activation or deactivation Password protection of your products, compatibility Most browsers require no coding.

7. White Label Login for WordPress

Have you ever wanted to change appearance a standard WordPress login window to make your site stand out from others? In this case, the WordPress White Label Login plugin is perfect for you.

8. Login Security for WordPress

Login Secury for WordPress is a two-step authentication system with a password and PIN sent via email or in the form of SMS. It was designed to significantly improve website security.

Security experts will tell you that user passwords offer little or no security. They are too easy to hack or steal. That's why companies and organizations are increasingly using two-factor mobile authentication to strengthen passwords and protect information online.

Two-factor mobile authentication uses phones to replace traditional keys or software tokens that were typically used for remote authentication. When someone tries to connect to an online service, a security notification is sent to their mobile phone by using voice message or SMS messages, not a token.

That's it! We hope this article helps you. If you have any comments or suggestions, please let us know in the dedicated section!

First of all, why do we need to protect some page or note with a password?

You may need this function for many cases. IN password protected page, You are posting materials that are not intended for public access. It could be various bonuses, gifts , which you give in exchange for the user performing certain actions. Perhaps it will be paid information , or information intended only for a certain circle of people , for example, for your partners or subscribers.

It could be deployed, step by step instructions for those to whom you want to provide in-depth knowledge in some issues. It could be Your information product, and much, much more.

IN in this case We will now look at blogs or sites made on the WordPress engine. very convenient and flexible. He has great potential. By the way, it was also made on this engine.

Protect with a password on the website c WordPress engine Can not only pages, but also posts . So everything that I’ll tell you now applies not only to stationary pages, but also to posts too, that is, to articles, which you periodically post on your blog or website.

So, how do you make such a page?

On WordPress blog this is done very simply. Come to administrative panel your blog and create new page: choose Pages - Add new .

After that, write the name, insert pre-prepared text, select the parent page and order if necessary, and click on the button Publish.

While we have not protected the page with a password, it is open to public access.

In order to protect page, go to the console in Pages - Edit , and in desired page let's go to Quick Edit .

Now that's enough set a password, and refresh the page.

To see its contents, you will now need to enter a password in the window.

That's all, the page is protected.

You can get more detailed information in the “All courses” and “Utilities” sections, which can be accessed through top menu site. In these sections, articles are grouped by topic into blocks containing the most detailed (as far as possible) information on various topics.

You can also subscribe to the blog and learn about all new articles.
It won't take long. Just click on the link below:

Have you ever thought about creating a blog post just for close friends or family members? Or publish an editor-only post on your WordPress site? The content publishing platform WordPress comes with some basic capabilities content visibility. In this article, we will show you how to create a password protected page or post in WordPress.

The same trick works for password protected pages in WordPress.

Hide password-protected posts entirely from the homepage and archives

All your password-protected posts can appear among your other posts on , or archives of your site. If you want to hide them completely, then you need to use this code in your theme or .

// Hide a protected post function exclude_protected_post($where) ( global $wpdb; return $where .= " AND ($wpdb->posts).post_password = "" "; ) // Display protected posts function exclude_protected_post_action($query) ( if(!is_single() && !is_page() && !is_admin()) ( add_filter("posts_where", "exclude_protected_post"); ) ) // Adding a filter for WordPress add_action("pre_get_posts", "exclude_protected_post_action");

This is all. Your protected posts will not appear on home page or site archives. You can email the URL to users with a password.

We hope this article helped you password protect a post in WordPress. You can also check how without user registration.

Why password protect?

Sometimes on a website it is necessary to show certain posts or pages only to a certain circle of people. So, this could be some kind of draft article for an editor or a publication for loved one. To do this, you can, for example, set a password that only those who are allowed to watch will know.

WordPress Features

WordPress has this feature, which is being implemented special function content visibility. To see how this works, let's create new entry(for pages the situation is similar). To do this, go to the admin panel Posts -> Add new. In the editor, pay attention to the block Publish.

There is a point here Visibility. This setting is responsible for the visibility of the content. If you press the button Change, a list of setting options will open.

When creating a post or article, its default visibility is set to Open. To change this and enable viewing with a password, you need to select the item from the list Password protected, where you will immediately be required to enter this same password. After entering, you must press the button OK.

Paragraph Visibility will immediately change the value to Password protected.

To apply all changes, you must click the button Publish. Now, when you go to the entry we created, you will receive a message asking you to enter a password.

After entering your password, you will be able to see the content of the post.

Still have questions?

Ask them to the experts in our telegram channel “WordPress Community”


By default WordPress hides the content of password protected posts, but it still shows the post title with the Protected prefix. In this article, we will tell you how to hide password-protected posts from the WordPress loop.

Why hide password-protected posts?

The title of a password-protected post still appears on home page website, in the list of recent posts, archives, and so on. If you want maximum content privacy, then this is not very cool. It also gives users who don't have passwords the opportunity to try entering them.

Hiding password protected posts in WordPress

Just add this code to your functions.php file

Function wpb_password_post_filter($where = "") ( if (!is_single() && !is_admin()) ( $where .= " AND post_password = """; ) return $where; ) add_filter("posts_where", "wpb_password_post_filter" );

All this code does is simply change the request sent to WordPress using the posts_where filter. It asks WordPress to collect all posts that do not have a password. Log into your site and you'll see that your password-protected posts are no longer visible on your homepage, archives, or widgets.

You can still access the post via a direct link to it. The example above hides password-protected posts from all users. What if you run a multi-author site and want password-protected posts to be visible to users with editing rights to private posts? Just change the code above with another tag:

Function wpb_password_post_filter($where = "") ( if (!is_single() && !current_user_can("edit_private_posts") && !is_admin()) ( $where .= " AND post_password = """; ) return $where; ) add_filter ("posts_where", "wpb_password_post_filter");

In this example, we are checking whether the user can edit posts that are password protected. If not, then it shows him only posts that do not have passwords.