How to Password Protect a Page or Post in WordPress

Have you ever thought about creating a blog post just for close friends or family members? Or publish a post just for editors on your WordPress site? As a content publishing platform, WordPress comes with some basic content visibility options that most beginners overlook. In this article, we will show you how to create a password protected page or post in WordPress.

When writing posts, there is an option called Visibility, which is set to Public by default. If you click Edit, then you will see options such as Password Protected and Private.

Making posts Private or Password Protected in WordPress

Simply click on Password Protected to add a password to your post. Doing so, only the friends, family members, or users you share this password with will be able to see this post.

A private post in WordPress is visible only to logged in users with the Editor or Administrator level user role in WordPress.

The same trick works for password protecting a page in WordPress as well.

Hiding Password Protected Posts Completely From Homepage and Archives

All your password protected posts may appear among rest of your posts on the homepage, or archives of your site. If you want to hide them completely, then use this code in your theme’s functions.php or in a site-specific plugin.

That’s all. Your protected posts will not appear in the site’s homepage or archives. You can send the post’s URL to users with the password.

We hope this article helped you password protect posts in WordPress. You may also want to check out how to make a whole WordPress site password protected without user registration.

Lượt xem: 15

Để lại một bình luận

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *