If you want to password protect individual posts, pages orWooCommerce ProductsWordPress actually includes a built-in feature to help you get through itsvisibilitySettings are set.
![图片[1]-如何用密码保护帖子、页面和 WooCommerce 产品-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/07/2024073103074589.png)
will be found in the WordPress editorvisibilitysetting, so it can be used for each type of content we mentioned above, as well as any other custom post types that may be used on the site.
Steps:
- Open the WordPress editor and find the content you want to add password protection to.
- In the right sidebar find theVisibility Options.
- Click on it.
- option"Password protection."and enter the password you want to use to unlock the post.
Here's what it looks like in the new WordPress block editor:
![图片[2]-如何用密码保护帖子、页面和 WooCommerce 产品-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/07/2024073102584814.png)
Here's what it looks like in the old Classic WordPress editor:
![图片[3]-如何用密码保护帖子、页面和 WooCommerce 产品-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/07/2024073103015586.png)
After posting or updating content, visitors will be prompted for a password before they can view the post. In addition, WordPress will add the word "Protected" to the post title:
![图片[4]-如何用密码保护帖子、页面和 WooCommerce 产品-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/uploads/2024/07/2024073103022536.png)
This method is rather ingenious and actually allows people to unlock multiple posts by entering their password at once. To set this up, simply reuse the same password across multiple posts. Pretty simple, right?
Once the visitor enters the password once, theIt will automatically unlock all content that uses the same password. However, if another portion of the content uses a different password, then the visitor is still required to enter that unique password.
Finally, just so you guys can see how this type of password protection works for different content, here's how it works in the WooCommerce product. As you can seevisibilityThe controls are displayed in the same position:

Link to this article:https://www.361sale.com/en/15105/The article is copyrighted and must be reproduced with attribution.




















![表情[wozuimei]-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/themes/zibll/img/smilies/wozuimei.gif)
![表情[baoquan]-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/themes/zibll/img/smilies/baoquan.gif)

No comments