Protect Multiple WordPress Content Sections with Single Password Form

Once you password protect your content partially, each protected area will be hidden under a password form. However, locking multiple sections of a page might confuse users since they’re not sure which form to enter the correct password.

To solve this problem, simply show a single password form and hide the others. Since PPWP Pro version, you can use the hidden_form_text attribute to display a text instead of a form or assign it to an empty value to display nothing.

Let’s say you want to create 2 protected sections for 2 types of users. The first part is unlocked with password “type1” and the other is unlocked with password “type2”.

Insert the following shortcodes to your content.

[ppwp passwords="type1 type2"] [/ppwp]

[ppwp passwords="type1" hidden_form_text="" ] Protected content for type 1 [/ppwp]

[ppwp passwords="type2" hidden_form_text="" ] Protected content for type 2 [/ppwp]

The first shortcode works as a replacement of the other 2 password forms. In other words, instead of showing both of them, you simply need to display only one form.

If users enter “type 1” in this form, they will see the content section 1. In case they fill in “type 2” in that same form, the content section 2 will show up.

Lasted updated on August 28, 2020