How to password protect posts in WordPress

After you have logged in to the admin panel, click the Posts menu on the left-hand side.
To add a new post or edit an existing one, click the Add New button or the Edit button of an existing post.
On the add/edit form, click on the Edit button for the Visibility setting in the Publish block.
A few radio buttons will appear. To enable the password protection, mark the radio button and provide password under the radio button.
Then click on the Update button (or the Publish button if it’s a new post). The button is in the Publish block too.

Posts will be shown to all users but only the title will be visible.
In order for users to view the full contents of a post, they have to type in the provided password under the title of the post.