Title: Master Post Password
Author: Scott Reilly
Published: <strong>2013 年 11 月 26 日</strong>
Last modified: 2025 年 4 月 25 日

---

搜索插件

![](https://ps.w.org/master-post-password/assets/banner-772x250.png?rev=811069)

![](https://ps.w.org/master-post-password/assets/icon-256x256.png?rev=972969)

# Master Post Password

 作者：[Scott Reilly](https://profiles.wordpress.org/coffee2code/)

[下载](https://downloads.wordpress.org/plugin/master-post-password.1.4.zip)

 * [详情](https://cn.wordpress.org/plugins/master-post-password/#description)
 * [评价](https://cn.wordpress.org/plugins/master-post-password/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/master-post-password/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/master-post-password/#developers)

 [支持](https://wordpress.org/support/plugin/master-post-password/)

## 描述

Define a master post password that works for all passworded posts, while permitting
the original post passwords to also work.

Once the master post password has been provided by a visitor for any passworded 
post on the site, it applies to unlock all other passworded posts (without needing
to provide the master post password again for each such post) until the site’s cookies
expire in the browser.

There are two means by which the master post password can be defined:

a.) As a constant, `C2C_MASTER_POST_PASSWORD`. This is typically done in wp-config.
php like so:

    ```
    define( 'C2C_MASTER_POST_PASSWORD', 'your_master_post_password' );
    ```

b.) Via the settings field labeled “Master Post Password” found on the `Settings`-
> `Reading` admin page.

If the constant is defined, it takes precedence and the settings field is _NOT_ 
displayed.

Links: [Plugin Homepage](https://coffee2code.com/wp-plugins/master-post-password/)
| [Plugin Directory Page](https://wordpress.org/plugins/master-post-password/) |
[GitHub](https://github.com/coffee2code/master-post-password/) | [Author Homepage](https://coffee2code.com)

## 屏幕截图

 * [[
 * A screenshot of the `Settings` -> `Reading` admin page showing the “Master Post
   Password” input field.

## 安装

 1. Install via the built-in WordPress plugin installer. Or install the plugin code
    inside the plugins directory for your site (typically `/wp-content/plugins/`).
 2. Activate the plugin through the ‘Plugins’ admin menu in WordPress
 3. Set a master post password
     a. via the ‘Settings’ -> ‘Reading’ admin menu b. (optional;
    advanced) Set the master post password via `C2C_MASTER_POST_PASSWORD` constant.
    This also serves to prevent the admin option from being displayed.

## 常见问题

### Does this work for *all* passworded posts, regardless of their explicitly set post password?

Yes.

### Does the explicitly set post password for a given post still work?

Yes. A visitor can supply either the post’s password or the master post password
to access the content.

### Will this require a password for posts that didn’t already have a post password configured?

No. It only affects posts that already have a post password.

### Does this remove or change the password for passworded posts to the master post password?

No. Any explicitly set post password remains unchanged and functional. The master
post password is saved separately from posts.

### If I have multiple password protected posts listed, do I need to provide the master post password for each one to view them all (a bit redundant since I obviously know the master post password and it applies to all of them)?

No, if you provide the master post password for one post, it’ll automatically be
applied to all passworded posts until the site’s browser cookies expire.

### What happens if I change the master post password?

Other than the obvious (the master post password has a new value), all existing 
users of the old master post password will expire when a browser attempts to view
a passworded post. The visitor will have to provide the original post password(s)
or the new master post password. If a visitor accessed a passworded post using the
post’s explicitly set post password, then they will not be affected by a master 
post password change.

### Is the master post password stored securely?

No. As is the case for post passwords in WordPress, the master post password is 
stored in the database as plaintext. That is unless the master post password is 
set by a constant, in which case it is never stored in the database and only in 
the given .php file (typically `wp-config.php`, where other site passwords are defined).

The master post password _is_ shown using a password input field, so it is not visibly
exposed to those who may be looking over your should or if you’re doing a screenshare
while navigating the admin. But you are encouraged to use the constant if you wish
to keep the password as private and secure as possible.

### Why can’t I see the setting on the “Reading Settings” admin page?

Are you logged in as an administrative user who can access the “Settings” -> “Reading”
admin page? Is the plugin installed and activated?

Assuming those are true, have you set a master post password via the `C2C_MASTER_POST_PASSWORD`
constant? If so, the admin setting will not be displayed.

### Does this plugin have unit tests?

Yes. The tests are not packaged in the release .zip file or included in plugins.
svn.wordpress.org, but can be found in the [plugin’s GitHub repository](https://github.com/coffee2code/master-post-password/).

### Is this plugin localizable?

Yes.

### Is this plugin GDPR-compliant?

Yes. This plugin does not collect, store, or disseminate any information from any
users or site visitors.

## 评价

![](https://secure.gravatar.com/avatar/8e84d9dcefeb62a8607d1149588130f46a6b780d90d8bf665654ac928de9f470?
s=60&d=retro&r=g)

### 󠀁[Excellent and simple](https://wordpress.org/support/topic/excellent-and-simple-43/)󠁿

 [](https://profiles.wordpress.org/minilobo/) 2021 年 8 月 9 日

It does what it says and does it well. Thanks!

![](https://secure.gravatar.com/avatar/0c264a65aec73ca96e23bf19c5b305643af89b540adfa346b3f54cedb1503619?
s=60&d=retro&r=g)

### 󠀁[Simple and works well.](https://wordpress.org/support/topic/simple-and-works-well-41/)󠁿

 [Pete](https://profiles.wordpress.org/perthmetro/) 2021 年 1 月 27 日

Very useful for securing all my password protected posts in one hit.

![](https://secure.gravatar.com/avatar/20192579f5617c00607ba616bc4e23a81cc7644c882e19fee9abcab00b9bb6a6?
s=60&d=retro&r=g)

### 󠀁[Simple and efficient](https://wordpress.org/support/topic/simple-and-efficient-274/)󠁿

 [](https://profiles.wordpress.org/minutepapillon/) 2020 年 6 月 23 日

With this little plugin I could turn my WooCommerce shop into a private shop … without
the very expensive Woo password plugin. Thanks !

![](https://secure.gravatar.com/avatar/532445e3030e140008471729805f811be6198abb59c6a62e10fbb20af9f54225?
s=60&d=retro&r=g)

### 󠀁[Works really well](https://wordpress.org/support/topic/works-really-well-89/)󠁿

 [scentedtreeju](https://profiles.wordpress.org/scentedtreeju/) 2017 年 4 月 20 
日

I had problems with massive-protected-posts with different passwords. But this plugin
saved me. Thank you for wonderful plugin.

 [ 阅读所有4条评价 ](https://wordpress.org/support/plugin/master-post-password/reviews/)

## 贡献者及开发者

「Master Post Password」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Scott Reilly ](https://profiles.wordpress.org/coffee2code/)

「Master Post Password」插件已被翻译至 1 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/master-post-password/contributors)
为本插件所做的贡献。

[帮助将「Master Post Password」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/master-post-password)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/master-post-password/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/master-post-password/)，或通过[RSS](https://plugins.trac.wordpress.org/log/master-post-password/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/master-post-password/)。

## 更新日志

#### 1.4 (2025-04-23)

 * New: Hide password via password input field, but allow its display to be toggled
 * Change: Add translation context for label of setting field
 * Change: Discontinue unnecessary explicit loading of textdomain
 * Change: Specify sanitization callback for registered setting
 * Change: Ignore unnecessary PHPCS complaint
 * Change: Note compatibility through WP 6.8+
 * Change: Note compatibility through PHP 8.3+
 * Unit tests:
    - Change: Explicitly define return type for overridden methods
    - Change: Explicitly define class variable to prevent PHP deprecation notice
 * New: Add some potential TODO items

#### 1.3.8 (2025-01-12)

 * Change: Prevent translations from containing unintended markup
 * Change: Note compatibility through WP 6.7+
 * Change: Update copyright date (2025)
 * New: Add `.gitignore` file
 * Change: Remove development and testing-related files from release packaging
 * Change: Tweak formatting in `README.md`
 * Unit tests:
    - Hardening: Prevent direct web access to `bootstrap.php`
    - Allow tests to run against current versions of WordPress
    - New: Add `composer.json` for PHPUnit Polyfill dependency
    - Change: In bootstrap, store path to plugin directory in a constant
    - Change: Prevent PHP warnings due to missing core-related generated files
 * Change: Add more potential TODO items and reformat some existing entries

#### 1.3.7 (2023-08-05)

 * Change: Note compatibility through WP 6.3+
 * Change: Update copyright date (2023)

_Full changelog is available in [CHANGELOG.md](https://github.com/coffee2code/master-post-password/blob/master/CHANGELOG.md)._

## 额外信息

 *  版本 **1.4**
 *  最后更新：**1 年前**
 *  活跃安装数量 **50+**
 *  WordPress 版本 ** 4.7 或更高版本 **
 *  已测试的最高版本为 **6.8.5**
 *  语言
 * [Chinese (Taiwan)](https://tw.wordpress.org/plugins/master-post-password/) 和
   [English (US)](https://wordpress.org/plugins/master-post-password/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/master-post-password)
 * 标签
 * [password](https://cn.wordpress.org/plugins/tags/password/)[post](https://cn.wordpress.org/plugins/tags/post/)
   [post password](https://cn.wordpress.org/plugins/tags/post-password/)[privacy](https://cn.wordpress.org/plugins/tags/privacy/)
 *  [高级视图](https://cn.wordpress.org/plugins/master-post-password/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  4 条 5 星评价     ](https://wordpress.org/support/plugin/master-post-password/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/master-post-password/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/master-post-password/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/master-post-password/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/master-post-password/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/master-post-password/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/master-post-password/reviews/)

## 贡献者

 *   [ Scott Reilly ](https://profiles.wordpress.org/coffee2code/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/master-post-password/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6ARCFJ9TX3522)