Title: RIACO Content Protector
Author: robertoiacono
Published: <strong>2025 年 12 月 4 日</strong>
Last modified: 2025 年 12 月 4 日

---

搜尋外掛

![](https://ps.w.org/riaco-content-protector/assets/banner-772x250.png?rev=3411405)

![](https://ps.w.org/riaco-content-protector/assets/icon-256x256.png?rev=3411405)

# RIACO Content Protector

 由 [robertoiacono](https://profiles.wordpress.org/prototipo88/) 開發

[下載](https://downloads.wordpress.org/plugin/riaco-content-protector.1.0.0.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/riaco-content-protector/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/riaco-content-protector/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/riaco-content-protector/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/riaco-content-protector/#developers)

 [技術支援](https://wordpress.org/support/plugin/riaco-content-protector/)

## 外掛說明

**RIACO Content Protector** allows you to protect _any part_ of your WordPress content
using a shortcode.
 Unlike the built-in post password protection, this plugin protects
only what you wrap, _not the whole post_.

Perfect for:

 * Protecting premium blocks of content
 * Protecting guides, downloads, links, or sensitive sections
 * Paywall-style snippets

### Features

 * Protect **only specific content** inside posts/pages
 * Uses a minimal shortcode:
    [riaco_content_protector] Hidden text here [/riaco_content_protector]
 * **Global password** stored in plain text, like WordPress page passwords.
 * AJAX-based form — no page reload
 * Unlocks **all protected sections** on the site after correct password
 * Optional cookie persistence (remember unlocked content for a configurable number
   of days)
 * Secure implementation using nonces, hashed tokens, and transients

**Important:**

 * The global password is stored in plain text, just like WordPress page passwords.
   It can be read by user with ‘manage_options’ ability.
 * If the global password or “Remember Unlocked” duration is changed in settings,
   all existing unlock cookies are invalidated. Users will need to re-enter the 
   new password to access protected content.

### How It Works

Wrap content you want to protect:

    ```
    [riaco_content_protector]
    This text will be hidden until the visitor enters the password.
    [/riaco_content_protector]
    ```

Set the global password under:

**Settings > Content Protector**

Visitors will see a modern, styled form.
 After entering the correct password:

 * The content unlocks immediately
 * All other protected areas unlock automatically
 * An optional cookie can keep everything unlocked for a chosen number of days

### Security

 * Nonces on every request
 * Secure HMAC token for cookie authentication
 * Sanitized shortcode attributes
 * Escaped output
 * No sensitive data stored in cookies
 * Global password stored in plain text, like WordPress page passwords.

### Cookie

We use this cookie to understand if user unlocked the content: `riaco_cp_unlocked_global`.

### Style

You can style the content protector box.

It has this class: `.riaco-cp--container`, so you can add in your `style.css`:

    ```
    .riaco-cp--container {
        background: #f8f9fa;
        padding: 20px;
        border: 1px solid #ddd;
        border-radius: 6px;
    }
    ```

You can replace button classes using:

    ```
    add_filter( 'riaco_cp_button_classes', function( $classes ) {
        return 'button my-custom-button-class';
    });
    ```

Or you can remove button classes:

    ```
    add_filter( 'riaco_cp_button_classes', function( $classes ) {
        // Remove wp-element-button
        return str_replace( 'wp-element-button', '', $classes );
    });
    ```

### License

This plugin is licensed under GPLv2 or later.

## 螢幕擷圖

 * [[
 * Frontend password form
 * [[
 * Protected content example
 * [[
 * Settings page with global password option

## 安裝方式

 1. Upload the plugin folder to `/wp-content/plugins/`
 2. Activate the plugin through **Plugins > Installed Plugins**
 3. Go to **Settings > Content Protector** and configure your global password
 4. Add the shortcode to any post or page
 5. [riaco_content_protector] This is hidden. [/riaco_content_protector]

## 常見問題集

### Can I protect multiple sections on the same page?

Yes. All instances use the same global password and unlock together.

### Does this protect the entire post?

No — only the content wrapped in the shortcode.

### Are passwords hashed in the database?

No, the global password is stored in plain text like WordPress page passwords for
easy admin management.

### Does this work with Gutenberg / block editor?

Yes. It works in both Classic and Block Editor.
 You can insert the shortcode inside
Paragraph block or using Shortcode block.

### What happens when I change the global password?

All previously unlocked content cookies are invalidated. Users must re-enter the
new password.

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈RIACO Content Protector〉的開發相關工作。

參與者

 *   [ robertoiacono ](https://profiles.wordpress.org/prototipo88/)

[將〈RIACO Content Protector〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/riaco-content-protector)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/riaco-content-protector/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/riaco-content-protector/)，或
透過 [RSS](https://plugins.trac.wordpress.org/log/riaco-content-protector/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/riaco-content-protector/)。

## 變更記錄

#### 1.0.0

 * Initial release
 * Shortcode protection
 * Global password
 * AJAX unlock
 * Cookie remember feature
 * Automatic unlock of all instances

## 中繼資料

 *  版本 **1.0.0**
 *  最後更新 **6 個月前**
 *  啟用安裝數 **少於 10 次**
 *  WordPress 版本需求 ** 6.2 或更新版本 **
 *  已測試相容的 WordPress 版本 **6.8.5**
 *  PHP 版本需求 ** 7.4 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/riaco-content-protector/)
 * 標籤:
 * [content-protection](https://tw.wordpress.org/plugins/tags/content-protection/)
   [hide content](https://tw.wordpress.org/plugins/tags/hide-content/)[password](https://tw.wordpress.org/plugins/tags/password/)
   [password protection](https://tw.wordpress.org/plugins/tags/password-protection/)
   [restrict content](https://tw.wordpress.org/plugins/tags/restrict-content/)
 *  [進階檢視](https://tw.wordpress.org/plugins/riaco-content-protector/advanced/)

## 評分

這個項目尚無任何評論記錄。

[Your review](https://wordpress.org/support/plugin/riaco-content-protector/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/riaco-content-protector/reviews/)

## 參與者

 *   [ robertoiacono ](https://profiles.wordpress.org/prototipo88/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/riaco-content-protector/)