Did you know that you canΒ password protect your WordPress posts? By default, WordPress does not show the contents of a protected post to users unless a password is entered. However, there are a couple of ways you can password protect posts while still showing a teaser or excerpt. In this article, we will show you how to show excerpt of a password protected post in WordPress.
Method 1: Manually Showing The Excerpt of a Protected Post
First thing you need to do is to copy and paste this code snippet in yourΒ child themeβs functions.php file or aΒ site-specific WordPress plugin.
Now go to Posts screen in WordPress to edit your password protected post and click on theΒ screen optionsΒ button on the top of the page. This will reveal a menu with a bunch of options. You need to make sure that the checkbox next to excerpt is checked.
This will display the excerpt meta box below the post editor. You can enter your postβs excerpt in this box.
Before publishing your post make sure it isΒ password protected. Now you can visit your website, and you will be able to see the excerpt for the password protected post in WordPress.
Method 2: Using a Plugin to Restrict Content
Using password protected posts is easier, but it does not give you the control you need to make sure that the right users have the access to the post.
If you run a multi-user WordPress site, or you are willing to open your site for registration, then using a plugin to restrict access to posts is a much better option.
It allows you to control which users have access to your protected posts, and you can easily control how much content you want to show to other users. Think of it as a membership site with multiple subscription levels.
First thing you need to do is install and activate theΒ Restrict Content ProΒ plugin. Upon activation, you need to visitΒ Restrict Β» SettingsΒ to configure the plugin.
You will need to provide the message users will see when they do not have the permission to view a protected content. Once you are done simply click on the save changes button to store your settings.
Now you can create a new post or edit an existing post that you want to protect. Simply add the content you want to show as excerpt in the post content area, and then wrap rest of the content that you want to hide betweenΒ [restrict] [/restrict]
Β tags.
Important: You donβt need to make a post password protected from the publish menu.
You can also show excerpt to all users and give access to only logged in users, by using the Restrict Content meta box below the post editor. Simply check the box next to excerpt and choose a user role.
Choosing a subscriber user role will allow all registered users on your site to view the post when they are logged in. Non logged in users will be able to see the excerpt only.
Selling Premium Content on Your Site
Restrict Content Pro also allows you to sell memberships for premium content. You can accept payments using Stripe, PayPal, and Braintree.
You can create subscription packages for users which they can choose from when registering on your site. You can decide what content users will be able to access for their subscription level. You can also have multiple subscription levels.
For detailed instructions, please take a look at our guide onΒ how to restrict content to registered users in WordPress.
We hope this article helped you show excerpt for password protected posts in WordPress. You may also want to see our list ofΒ 40 useful tools to manage and grow your WordPress blog.
If you liked this article, then please subscribe to ourΒ YouTube ChannelΒ for WordPress video tutorials. You can also find us onΒ TwitterΒ andΒ Facebook.