Many Imagely users take advantage of protecting their galleries with passwords. This is done using the WordPress feature for password protection of posts and pages.
A use case for doing so might be implementing a proofing gallery for a client, or a private gallery of family photos.
By default, if you create a blog post with password protection it will wind up in your blog archives, on your main blog page and even in the Recent Posts widget. That is not ideal as it can confuse your website visitors as to why there is new content inaccessible to them. It would look something like this:
To fix it, install PPWP – Password Protect Pages. Its visibility settings keep protected posts out of your blog page, archives, search results and the Recent Posts widget, so visitors never run into an entry they cannot open. Your site will now look like this:
The best part is this works for any password protected content and not just Imagely galleries.
Prefer not to add a plugin? WordPress has been able to do this on its own since version 3.9. Post queries accept a has_password argument, and setting it to false returns only the posts that are not protected. Added to your theme’s functions.php, this clears them from your blog page and archives:
add_action( 'pre_get_posts', function( $query ) {
if ( is_admin() ) {
return;
}
if ( $query->is_main_query() ) {
$query->set( 'has_password', false );
}
} );
Widgets and custom loops run their own queries, so those still need the plugin above or a filter of their own.
It’s worth noting that if you want granular control over indexing your pages and posts as well, AIOSEO lets you stop a page or post from being indexed by search engines. If you would rather not bother with that, no need to worry: search engines cannot crawl a page or post that is password protected anyway.


