How to Password Protect WordPress Content based on Levels

PPWP Access Levels extension allows you to automatically protect all fresh content once they are published as well as set password levels to unlock them.

Currently, we support to protect WordPress Posts and WooCommerce Products Categories based on Levels. If your custom post type uses built-in WordPress Categories, you need to add this post type to Post Type Protection option under PPWP Pro settings page first.

Requirements:

In this tutorial, we will walk you through the following sections:

How to create Access Level (AL) passwords

Step 1: Create a base

Once activating our plugins successfully, go to Password Protect WordPress >> Access Levels from your admin dashboard.

Click on Add New Base button.

This will bring up a popup window where you can add a base name (required) and a base description (optional).

Step 2: Order categories based on levels

After creating a base, click on Edit Levels button link.

Then you select which post type and the categories you want to protect.

Please note that Products does not display under Post Type option by default. In order to protect Products, you need to add this type to Post Type Protection option under PPWP Pro settings page first.

You can also protect categories by levels. Categories under a specific level will be unlocked by a password in the same or higher levels.

Because “Markup” category isn’t added to any levels, it will be assigned Level 0 by default.

Categories not belonging to any levels will be assigned Level 0 by default. That means their content will be unlocked by any password at any level.

Please note that:

  • Unable to create a new level while the highest level is empty
  • Unable to remove a selected category from Base once levels are created
  • Levels must be deleted in order. In other words, you can’t remove level 1 if level 2 still exists.
  • Deleting a level will remove all associated passwords

Step 3: Create AL passwords

Once you add a category to a base, all content under this category will be password protected, including the new one. To unlock these posts, you need to create a password with the corresponding level.

To do so, switch to Add New Password tab and generate a new password with these pieces of information:

  1. New Password: unique, no space, case-sensitive and limited to 100 characters
  2. Label: Allow to give some extra information for your password, e.g. what it is used for
  3. (Password) Level: Assign a level to this password. Higher-level passwords can unlock all content in the same or lower levels.
  4. (Password) Type:
    • Global (default): anyone with the password can unlock the protected content
    • Roles: only specific user roles are able to use the password to access the private categories.
      • Let’s say you set a password with type Role (editor)
        • Only editors can use this password to unlock your protected base.
        • Other roles, e.g. subscribers, will receive an error message when entering it into password form
  5. Usage Limit: the maximum number of times a password is used.
    • Let’s assume that the usage limit is set to 1. If a user enters that password to unlock the base, others can’t use it anymore.
    • This feature proves useful to prevent users from sharing your passwords without permission.
  6. Password Expiry: Make your password auto-expire after a period of time. In other words, users won’t be able to use that password to access your content after a given time.

After creating a new secure password successfully, you will be redirected to the Manage Passwords tab, where you can see and manage all your created passwords.

Feel free to create as many passwords at a specific level as you want.

How to manage bases

Under Access Levels Management dashboard, you can

  • Create as many bases as you wish. You can create a base to protect Posts and another one to protect Products, for example.
  • Switch base status from active to inactive and vice versa
    • If you deactivate a base, all content belonging to this base will become unprotected.
    • When you re-activate a base, all its content will become protected again.
  • Delete a base
    • If a base is deleted, all its passwords are removed too. In other words, you can set these passwords to protect other bases.
    • All content belonging to this base will become unprotected. So you can add the selected categories to other bases.

How AL passwords work

Password access levels is a system in which higher-level passwords can unlock all content in the equal or lower levels. For example, you can use password level 2 to unlock all content belonging to categories in levels 2, 1 and 0.

Protect category pages

Since version 1.1.1, once a category is locked with PPWP Access Levels, its category page is protected as well. In other words, when accessing a secure category page, your users, instead of seeing a list of password protected posts, will be required to fill in a password form.

Hide protected categories

In order to hide protected categories from the navigation menu, go to the Products >> Categories page and select which categories you want to protect. Tick on the checkbox next to “Hide category” to change its visibility.

Please note that hidden categories feature is available to Products by default.

Lasted updated on August 28, 2020