In this article, we will show you 2 ways to password protect content sections with WP Bakery Page Builder.
- Password Protect WordPress Lite plugin version 1.4.5 or greater
Option 1: Create a shortcode element
WPBakery Page Builder comes with a built-in function called Shortcode Mapper, which allows adding a 3rd-party shortcode to the element list for easy reuse.
Step 1: Once activating Password Protect WordPress Lite plugin, navigate to the settings page and switch to “Shortcode” tab.
Copy the sample shortcode under the Partial Content Protection option.
Step 2: Go to WPBakery Page Builder >> Shortcode Mapper to create a custom shortcode element.
- Click on “Map Shortcode” button
- Copy the sample shortcode into the input field
- Press “Parse Shortcode”
Step 3 (optional): Custom some values of
- whitelisted_roles: change the Field type to Dropdown and add “
administrator,editor,subscriber,author,contributor” as default values. So you don’t have to type the whitelisted roles whenever creating password protection section. Please note that you can’t select multiple roles with Dropdown at once.
- content: change the Field type to Textarea HTML so you can add other file types and edit the content with WYSIWYG-Editor.
Don’t forget to press “Save Changes” to save this shortcode element.
Once done, whenever editing a page with WPBakery Page Builder, you can easily find the new shortcode element displayed in the element menu (default “My Shortcodes”).
This option comes in handy when you need to protect part of the content from time to time. However, it can’t help you to restrict multiple elements or an entire template at once. In this case, you need to warp the protected content with
[ppwp] shortcode manually.
Option 2: Warp content with shortcode manually
Step 1: Create your content as normal
Step 2: Switch to Classic Mode
Step 3: Warp all sections you want to password protect with