The Content Protection extension allows you to restrict access to specific content in your Elementor widgets based on user roles or password protection. This ensures that only authorized users can view the protected content, with customizable messages and styles for the content protection forms.
Features
- Role-based Content Protection: Restrict content visibility to users with specific WordPress roles.
- Password-based Content Protection: Lock content behind a password, with an option to remember users via cookies.
- Customizable Protection Messages: Define custom messages displayed to unauthorized users.
- Style Options: Customize the appearance of protection messages and forms, including alignment, typography, color, and more.
Activate the extension
This extension is part of the Premium version of the aThemes Addons for Elementor plugin. To activate it, go to your admin area, visit the aThemes Addons dashboard, search for the extension and click on the switch to activate it. It will now be available in your Elementor interface.
How to use
1. Enabling Content Protection
To enable content protection:
- Open the Elementor editor and select the widget you wish to protect.
- Navigate to the Content Protection section in the widget’s settings.
- Enable content protection by toggling the Enable Content Protection option.
2. Role-Based Protection
With role-based protection, only users with specific WordPress roles can access the content.
- Set the Protection Type to “Role.”
- Select the user roles that are allowed to view the content.
- If a user does not have the required role, a custom message will be displayed instead of the protected content.
Example Settings:
- Role Selection: Choose from Administrator, Editor, Author, Subscriber, or other custom roles.
- Custom Message: Display a message to unauthorized users (e.g., “You do not have permission to view this content.”).
3. Password-Based Protection
If you prefer password-based protection:
- Set the Protection Type to “Password.”
- Define the password that users must enter to view the content.
- Customize the password form, including placeholder text, submit button label, and error messages for incorrect passwords.
- Optionally, enable Remember Me functionality via cookies to remember users for a set number of days.
Example Settings:
- Password: The password users must enter to access the content.
- Custom Form: Customize form fields like placeholder text, submit button text, and wrong password message.
Cookie Settings for Password-Based Protection
You can enable cookie functionality to remember users who have entered the correct password.
- Remember Me: When enabled, users who enter the correct password will not have to re-enter it for the specified number of days.
- Cookie Duration: Define how many days the cookie will last (e.g., 7 days, 30 days).
FAQs
Q: Can I protect content for specific users only?
A: Yes. You can use role-based protection and select specific user roles that should have access.
Q: Can I customize the password form?
A: Yes. You can customize the form’s alignment, button color, and the error message shown when the wrong password is entered.
Q: How does the cookie feature work?
A: If enabled, once a user enters the correct password, a cookie will be set, remembering their access for the number of days you specify, so they won’t need to re-enter the password during that time.
Conclusion
The Content Protection extension offers an easy way to lock down specific content based on user roles or passwords. With its robust customization options, it provides a flexible, secure way to control access to sensitive or premium content.