| 开发者 |
Namith Jawahar
namithjawahar |
|---|---|
| 更新时间 | 2026年11月26日 18:05 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[protected] and [/protected]. Logged-out visitors see a login form, or a login link, exactly where the hidden part would be. After logging in they are returned to the same post and see everything.
What it does
/wp-content/plugins/, or install it from the Plugins screen, and activate it.[protected] before the part to hide and [/protected] after it, in a Shortcode block or in paragraph text.Put the part between the two tags:
Everyone can read this. [protected]Only logged-in users can read this.[/protected] Everyone can read this too.
Yes. Every [protected] ... [/protected] pair is handled on its own.
By default, a short line asking them to log in, followed by a login form. In Settings > WP Private you can choose a login form, login and register links (the register link appears only when your site allows registration), or nothing at all, and you can write the HTML shown before and after the prompt.
Back to the same post, also on sites installed in a subdirectory.
Yes to both, in Settings > WP Private. The shortcode [loginform] shows a login form anywhere in a post or page. Logged-in users see a greeting and a logout link instead.
Yes. Add the user to the block list in Settings > WP Private. Blocked users see the message you write there instead of the content.
Yes: put the shortcode in a Shortcode block or in paragraph text. A dedicated block is planned.
From logged-out visitors, in the places listed in "What is protected" above. Read the search row of that table: a search can still return the post, though never the hidden text. Plugins that read raw post content are not controlled by WP Private.
Page caches normally serve cached pages to logged-out visitors only, which is the case the gate is built for. Tested configurations will be listed in a later release.
From 2.0.0 the login form appears inside the post, where the hidden part is, instead of at the top of the page. Your [protected] shortcodes are unchanged and your settings were moved to a new format automatically when the plugin first ran.
<!--protected--> comments in version 1.4 or 1.5. Do they still hide content?No. Comment-style markers stopped working in 1.6 and do not work in 2.x. Content that you hid that way is visible. Replace the markers with [protected] and [/protected].
Going back to 1.6.1 is not supported. If you do it, [protected] still hides content, but 1.6.1 reads the settings as they were at the moment you upgraded, so changes made in 2.x, including the block list, do not apply. On a site first installed on 2.x, 1.6.1 hides protected parts from everyone until its settings are saved. Going forward to 2.x again keeps your 2.x settings and ignores edits made in 1.6.1.
The shortcode stops working and the hidden text becomes visible, together with the shortcode tags. Remove the tags and review the content before you delete the plugin.
Its options stay in the database, so reinstalling restores your settings. Nothing is deleted on upgrade or on deletion. The options are:
wp_private_versionwp_private_settings_typewp_private_settings_before_htmlwp_private_settings_after_htmlwp_private_settings_authorized_textwp_private_settings_blocked_userswp_private_settings_custom_login_page_urlwp_private_settings, wp_private_replacement_type, wp_private_before_html, wp_private_after_html, wp_private_not_authorized_text, wp_private_selected_users, wp_private_custom_login_page_url and wp_private_linkback_enable. To remove them, delete them by hand (for example with WP-CLI: wp option delete wp_private_version).
Settings that accept HTML are filtered with the same rules as post content for users who do not have the unfiltered_html capability (for example administrators on multisite sub-sites). Administrators with that capability can save any markup. HTML you saved with an earlier version is output as stored until you change it.
It is a known limit. WordPress searches the stored text of a post, including the hidden part. A search for a word that appears only in the hidden part returns the post, and shows its title and the visible text, never the hidden part. A fix is planned for a later release.
Please do not post it in the support forum. Email security@smartlogix.co.in. A policy is in SECURITY.md in the plugin's repository.
[protected] shortcodes are unchanged and your settings are moved to a new format automatically; going back to 1.6.1 afterwards is not supported.