Password-protecting posts in WordPress is a great way to control access, but by default, it hides everything until the password is entered. Want to tease visitors with an excerpt? As experienced WordPress developers, we've tested these reliable methods to show excerpts from protected posts without compromising security.

Add this code snippet to your child theme's functions.php file or a site-specific plugin for precise control.
function wpb_protected_excerpt( $excerpt ) {
if ( post_password_required() ) {
$post = get_post();
$excerpt = $post->post_excerpt;
}
return $excerpt;
}
add_filter( 'the_excerpt', 'wpb_protected_excerpt' );
function wpb_protected_excerpt_posts( $content ) {
if ( post_password_required() && is_single() ) {
$post = get_post();
return $post->post_excerpt . $content;
}
return $content;
}
add_filter( 'the_content', 'wpb_protected_excerpt_posts', 10 );Edit your password-protected post in WordPress. Click Screen Options at the top, then check Excerpt to reveal the excerpt box below the editor.

Enter your teaser text in the excerpt field.

Ensure the post is password-protected, publish, and visit the front end. You'll see the excerpt displayed.

Password protection works for simple cases, but for multi-user sites or memberships, plugins offer superior flexibility and user management.
Install and activate Restrict Content Pro. Go to Restrict » Settings to customize the access-denied message, then save changes.

In your post, add unrestricted teaser content first, then wrap protected sections in [restrict][/restrict] shortcodes. No need for WordPress's built-in password option.

Tip: Use the Content Restriction box under the editor. Check it, select a user role like Subscriber, and logged-in users see everything—others get just the excerpt.

Restrict Content Pro supports paid memberships via Stripe, PayPal, or Braintree. Create tiered subscriptions to gatekeep premium content effectively.

For more, check our guide on restricting content to logged-in WordPress users.
This approach has helped countless sites balance accessibility and exclusivity. Also explore our list of 40+ tools to manage and grow your WordPress blog.
Subscribe to our WordPress YouTube channel for video tutorials. Follow us on Twitter and Facebook.