How to protect part of a page/post

If you’re looking to protect only part of a page or post on your WordPress site, you can do so with Passster’s Area Protection.

How to protect part of a page/post 1

The first thing you’ll need to do is create the area you want to protect.

Create your protected area

To do this, take the following steps:

  1. From your WordPress dashboard, go to Passster > Protected Areas.
  1. Click the Add New button at the top of the page. This will open up a page that looks a lot like a normal page editor in WordPress.
How to protect part of a page/post 2
  1. Give this ‘area’ a title. 
    1. This title is only used on the backend of your site (it will not be visible on the front end of your site). So give it a name that will help you organize/structure it better.
  2. Then add your ‘area’ content. 
    1. You can add anything you would normally add to a page or post in this section.
How to protect part of a page/post 3
  1. Once happy, click the Publish button at the top of the page.

Note: You can also use your Page Builder theme here. To do this, you’ll need to activate Protected Areas in your page builder before you can use it to style your areas. 

Here are a couple of tutorials on how to do that:

Once you’re happy with your content, we’ll need to generate and customize the shortcode.

Customize your shortcode

Once you’ve saved or published your page, you’ll see a shortcode has been created in the Shortcode section (usually found below the content you just created).

A shortcode is a small amount of text and numbers within square brackets like this: [passster password=”password” area=”81″]

How to protect part of a page/post 4

This shortcode can then be added to any WordPress page or post to display your protected content hidden behind a form.

Now that your basic shortcode has been created, there are a few settings you can change that will alter what kind of protection you’d like. This will also change the contents of the shortcode itself.

To do this, take the following steps:

  1. While still on the edit page for your protected area, open up the settings sidebar if not already open. You can do this by clicking the black cog symbol at the top right. Make sure the Protected Area tab is clicked at the top.
  2. Then scroll down to the Shortcode Configuration section.
How to protect part of a page/post 5
  1. Here you’ll be able to pick the type of protection you’d like from the Protection Type dropdown. Including:
    1. Password
    2. Multiple Passwords
    3. Password lists
    4. Captcha
    5. Google ReCaptcha
    6. API
How to protect part of a page/post 6
  1. Based on your selection, the fields below this will change and the description text underneath it will guide you on how to fill out the fields.
  2. Next, scroll to the User Restriction section. Here you’ll be able to decide if you want to automatically unlock the content for certain users or user roles.
How to protect part of a page/post 7
  1. Lastly, in Texts, you’ll be able to change the form headline, description, placeholder and button texts for your shortcode.
  2. Once you’ve made all your changes, click Update and your shortcode will be updated too (you may need to refresh the page to see changes).
How to protect part of a page/post 4
  1. Once done, copy the shortcode and we’ll move on to the next stage.

We’ve created our protected area and decided how we want to protect it, so now let’s get it added to a page/post.

Add your shortcode to a page/post

Adding this shortcode and therefore your protected area to a page or post only takes a few steps:

  1. From your WordPress dashboard, go to Pages > All Pages and click to edit the page you want to add your protected area to.
    • Of course, at this stage, you could also create a new page/post and then take the same steps below.
  2. Next, click within the content area itself and paste the shortcode. WordPress should automatically turn it into a shortcode ‘block’.
How to protect part of a page/post 9
  1. If this doesn’t work, instead, click inside the content area and click the black + symbol. Search ‘shortcode’ in the search field that pops up and click on it to add. Then paste your shortcode into the shortcode ‘block’.
How to protect part of a page/post 10

Once done click Update at the top of the page and your protected area will appear.

How to protect part of a page/post 11