您可能想要对Word (Word)Press ( (P)WP(ress) ) 网站上的页面进行密码保护的原因有多种,包括:
- 需要一个安全的地方与当前或潜在客户共享内容。
- 使用您的网站仅与家人或朋友分享图像、故事或通讯。
- 仅限受邀网络研讨会参与者的内容。
- 包括面向付费会员而非公众的内容。
- 根据员工在公司中的角色,屏蔽一些商业网站的内容区域。
- 确保外人看不到医疗或教育设施的专有内容。
以下是密码保护单个页面或帖子、特定类别或整个WordPress网站的几种方法。
密码保护页面或在 WordPress 中发布(Password Protect a Page Or Post In WordPress)
限制对帖子或页面的访问的最简单方法是在 WP 中编辑可见性设置。
- 首先(Start)在 WP 仪表板中打开或编辑页面。在右侧,在Publish下,单击Visibility旁边的Edit。
- 选择密码保护,(Password protected, )输入密码,然后单击确定(OK)。
- 发布页面并查看结果。现在,当任何人查看该页面时,都会要求他们输入密码。
- 只有拥有正确密码的人才能访问您的内容。如果您想保护一些页面或帖子,此过程很有用。
密码保护您的 WordPress 网站中的帖子类别(Password Protect Post Categories in Your WordPress Site)
如果您的网站上有特定类别的帖子要使用密码保护,请使用访问类别密码( Access Category Password)插件。
下载(Download)、安装和激活插件。
选择(Choose)通过分配密码来限制对特定类别中帖子的访问。帖子的摘录和内容都被访问者需要填写才能访问的表单所取代。
WP 生成的提要被修改。您可以在用户将看到的设置中定义描述。参数定义为:
- 密码(password)网站访问者将需要访问受限类别。
- 通过勾选受影响类别(Impacted categories)中的框来选择您想要保护的类别。
- 授予用户(Granting users)部分是指您的网站用户的角色。您检查的那些不需要输入密码。
- 如果您勾选Only single post,则帖子内容将显示在您的主页或存档页面上。只有来自受限类别的帖子的单个帖子页面将受到保护。将此未选中保留为默认值。
此密码保护插件的其他设置定义如下:
- 在Info message(Info message)中添加用户将在密码表单之前看到的消息。
- 选择您想要在密码(Password)字段中显示的内容并将其放入Input placeholder。
- 如果访问者使用了错误的密码,请指定您希望显示为错误消息的文本。(Error message)
- 对于验证按钮文本(validation button text),输入您希望按钮显示的内容,例如获取(Get)访问权限。
- 如果您不喜欢表单的样式(Styling of the form),请添加自定义样式。
- 添加您的提要描述文本(feed description text)。
如何密码保护WordPress帖子或页面的一部分(How To Password Protect Part Of a WordPress Post Or Page)
您还可以仅对公共页面的一部分进行密码保护,或者使用另一个名为Passster – Password Protection的 WP 插件发布。
就像您对所有 WP 插件所做的那样,下载、安装并激活它。
在您的 WP 仪表板中,转到插件的设置(Settings)。创建简码和密码(Password)或自动为您生成。
在您的 WP 编辑器中,将短代码粘贴到您要保护的部分并写入内容。
访问者将看到您的所有内容,除了您在短代码部分中放置的内容。
密码保护您的整个 WordPress 网站(Password-Protect Your Entire WordPress Site)
要使用密码保护您的整个WordPress网站,您可以再次使用第三方插件。有几个密码保护插件(password-protect plugins)可供选择。
我们将讨论Ben Huson 的密码保护免费插件(Password Protected free plugin by Ben Huson)。
- 下载(Download)、安装和激活插件。要配置设置,请转到设置(Settings)>密码保护(Password Protection)。
- 勾选密码保护状态(Password Protected Status)旁边的框以启用插件。如果您勾选任何密码权限(Password Permissions)选项旁边的框,这些访问者将不需要密码来访问您的网站。
- 在新密码(New Password)框中添加您的密码,然后单击保存更改(Save Changes)。
- 激活插件后,当访问者登陆您的网站时,他们将看到较短版本的 WP 登录页面并被要求输入密码。
请记住,该插件只会保护您的 WP 网站。如果有人直接链接到您服务器上的文件或图像,他们将能够看到该文件。
如您所见,有多种方法可以对您的WordPress网站进行密码保护。对于单个帖子或页面,您可以使用WordPress内置功能。其他部分、部分或整个站点将需要第三方插件。
How To Password-Protect Pages On Your WordPress Website
There are several reasons you might want to password protect pagеs on your WordPress (WP) site, including:
- Needing a secure place to share content with current or potential clients.
- Using your website to only share images, stories, or communications with family or friends.
- Restricting content for invited webinar attendees only.
- Including content that is for paid members and not the general public.
- Blocking off some content areas for business websites based on the employee’s role in the company.
- Ensuring outsiders can’t see proprietary content for medical or educational facilities.
Below are several ways to password protect single pages or posts, specific categories, or your entire WordPress website.
Password Protect a Page Or Post In WordPress
The easiest way to restrict access to a post or page is to edit the visibility settings in WP.
- Start by opening or editing a page in your WP dashboard. On the right-hand side, under Publish, click on Edit next to Visibility.
- Select Password protected, enter a password, and click OK.
- Publish the page and see the results. Now, when anyone looks at that page, they will be asked to enter the password.
- Only those with the correct password will have access to your content. This process is useful if you want to protect a few pages or posts.
Password Protect Post Categories in Your WordPress Site
If you have specific categories of posts on your site that you want to protect with a password, use the Access Category Password plugin.
Download, install, and activate the plugin.
Choose to restrict access to posts within a specific category by assigning a password. Both the excerpt and content of the posts are replaced by a form that visitors will need to complete to gain access.
WP generated feeds are modified. You can define a description in the settings that users will see. The parameters are defined as:
- The password website visitors will need to access restricted categories.
- Choose the categories you want to protect by ticking off the boxes in Impacted categories.
- The Granting users section refers to the roles of your website users. The ones you check will not need to enter a password.
- If you check off Only single post, the post content will display on your homepage or archive pages. Only the single post page of posts from the restricted categories will be protected. Leave this unchecked as the default.
The other settings for this password protect plugin are defined below:
- Add the message users will see before the password form in Info message.
- Choose what you want displayed in the Password field and put it in Input placeholder.
- Specify the text you want to appear as an Error message if a visitor uses the wrong password.
- For the validation button text, input what you want the button to say such as Get access.
- If you don’t like the Styling of the form, add custom styling.
- Add your feed description text.
How To Password Protect Part Of a WordPress Post Or Page
You can also password protect only part of a public page or post with another WP plugin called Passster – Password Protection.
Just as you do for all WP plugins, download, install, and then activate it.
Inside your WP dashboard, go to the Settings of the plugin. Create a shortcode and a Password or automatically have it generated for you.
In your WP editor, paste the shortcode in the section you want to protect and write the content.
Visitors will see all your content except what you have put inside the shortcode section.
Password-Protect Your Entire WordPress Site
To password protect your entire WordPress site, you can again use a third-party plugin. There are several password-protect plugins from which to choose.
We will discuss the Password Protected free plugin by Ben Huson.
- Download, install, and activate the plugin. To configure the settings, go to Settings > Password Protection.
- Tick off the box next to Password Protected Status to enable the plugin. If you tick off the box next to any of the Password Permissions options, those visitors will not need a password to access your site.
- Add your password in the New Password box and click Save Changes.
- After you activate the plugin, when a visitor lands on your site, they will see a shorter version of the WP login page and be asked to enter a password.
Keep in mind that the plugin will only protect your WP site. If someone has a direct link to a file or image on your server, they will be able to see that file.
As you can see, there are several ways to password-protect your WordPress site. For individual posts or pages, you can use WordPress built-in functionality. Other parts, sections, or the entire site will need third-party plugins.