Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Add Content Locking in WordPress (2 Methods)

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Do you want to add content locking on your WordPress site?

Many websites use content locking to boost their lead generation, increase sales, or build their email list. You will see this on many news and journalism sites that lock articles to make money online.

In this article, we will show you how to add content locking in WordPress without annoying users.

How to add content locking in WordPress

What Is Content Locking?

Content locking is a technique used by site owners to encourage their users to take action.

That action might be anything from signing up for an email newsletter to paying for premium content.

Content locking OptinMonster

Content locking works similarly to content upgrades. When you offer valuable content on your WordPress websites, such as a course or eBook download, you give your visitors a reason to take the initiative and sign up for a membership.

Doing this effectively can help you generate leads, build an email list, and grow your business. But if you don’t set up content locking in the best way, then visitors to your site may find it annoying.

That being said, let’s see how you can easily add content locking in WordPress the right way. Method 1 is best for exclusive free content, and Method 2 is for premium paid content:

Method 1: Add Content Locking With OptinMonster (Free Content)

OptinMonster is the best lead generation plugin for WordPress on the market. It’s the best choice if you want to use exclusive content to grow your email list.

You can read our complete OptinMonster review for more details.

You will need a Plus or higher plan for content locking. WPBeginner users can get a 10% discount by using our OptinMonster coupon.

First, you will need to visit the OptinMonster website and click the ‘Get OptinMonster Now’ button to sign up for a plan.

OptinMonster – The best WordPress popup plugin

Next, you need to install and activate the OptinMonster plugin. For more details, see our guide on how to install a WordPress plugin.

Upon activation, you will see the welcome screen and the setup wizard. Simply click the ‘Connect Your Existing Account’ button and follow the on-screen instructions.

Connect your existing account

Next, you will see a new popup window open to connect your WordPress site with OptinMonster.

Go ahead and click the ‘Connect To WordPress’ button.

Connect OptinMonster to WordPress

Once you’ve done that, you will then need to log in to your OptinMonster account or create a new one.

After you are successfully connected, you should navigate to the OptinMonster » Campaigns page in your WordPress dashboard. Since you haven’t yet made a campaign, you will be asked to create a new one.

Create first OptinMonster campaign

When you click the ‘Create Your First Campaign’ button, a popup window will open.

OptinMonster will ask you to choose from templates or playbooks. If you select the ‘Templates’ option, then you can pick from 300+ designs for your campaign.

On the other hand, you can also opt for the ‘Playbooks’ option and use a ready-to-use campaign inspired by successful brands.

Creating a campaign using a ready-made playbook

For this tutorial, we will select the ‘Templates’ option.

Next, you will be taken to the OptinMonster website and asked to pick a campaign type.

To add content locking, you will need to choose the Inline option.

OptinMonster campaigns

You will then need to scroll down and choose a template. OptinMonster offers multiple templates, and they all work great across any device.

You can view each template by clicking on the ‘Preview’ button. When you find one that matches your needs, you will need to click the ‘Use Template’ button.

Choose an inline campaign template

You will then be asked to provide a title for your campaign.

Once you’ve typed it in, simply click the ‘Start Building’ button.

Click the Start Building button

This will open the OptinMonster editor. Here, you can spend time perfecting the content and appearance of the popup.

For instance, you can use the drag-and-drop campaign builder to add different blocks to the template. There are blocks for adding columns, text, images, videos, countdown timers, and more.

Customize your content locking campaign

You can click on any section to change the wording, edit fonts, add images, change colors, and more.

You can also customize the success message that’s displayed to your users after they sign up.

Edit success view of campaign

Once you are happy with the way your popup looks, you need to activate content locking.

To do that, you will need to switch to the ‘Display Rules’ tab. Here, you can choose when and where the campaign will be displayed to users.

For instance, you can show the content lock popup on all the pages of your WordPress website or just on selected pages.

Display rules settings OptinMonster

Once you are done, simply click the ‘Done? Go To Actions’ button.

On the next screen, you will see options to add animation with MonsterEffects and play a sound when the popup appears.

To lock content behind the popup, simply go to the ‘Lock Content’ section and click the ‘Enable Content Locking’ toggle.

Enable content locking option

If you scroll down, there are more campaign display options.

For instance, OptinMonster lets you configure the cookie settings and set the days after which the popup will show to different users.

Changing the cookie settings

After that, you need to make the campaign active.

Simply click on the ‘Published’ tab at the top of the screen and then click on the ‘Publish’ button.

Publish your content locking campaign

Then, you can save your campaign by clicking the ‘Save’ button at the top right and closing the campaign builder.

Next, you will see the WordPress Output Settings for your campaign. Here, OptinMonster will ask how you’d like to show your inline campaign.

The Automatic option is the simplest to set up. It will lock content automatically after a specified number of words or paragraphs. For example, you could lock all content after the first three paragraphs of each post.

Select how inline campaign will appear with automatic mode

The Manual setting requires a little more work, but it lets you choose exactly which content will be locked.

You can do this by adding a shortcode to each post that you wish to lock.

Select how inline campaign will appear with manual mode

Simply start by copying the shortcode.

To add it to your content, you will need to edit the post or page where you want to enable content locking.

When you are in the WordPress content editor, just add a Shortcode block and paste the shortcode just before the content you wish to lock.

Enter shortcode for content locking

Now, you can save and publish your post or page.

If you’d like to see content locking in action, then simply visit the post or page in a new browser window.

Content locking example

The locked content is blurred or hidden.

Once a user enters an email address, the locked content will be displayed.

Content unlocked preview

Method 2: Add Content Locking With MemberPress (Paid Content)

MemberPress is the best membership plugin for WordPress, and you can use it to easily and effectively lock your WordPress content. It’s the best choice when you want to make money by charging for premium content.

Is MemberPress the right membership plugin for your WordPress website?

You will need at least a Basic plan for content locking. WPBeginner users can save up to $479 off their first year of MemberPress using our MemberPress coupon.

The first thing you need to do is install and activate the MemberPress plugin. For more details, see our guide on how to install a WordPress plugin.

On activation, you will have to enter your MemberPress license key. To do that, navigate to MemberPress » Settings and paste your key into the text box. You then need to click the ‘Activate License Key’ button.

Adding a license key to your MemberPress plugin

When you first set up your membership site, you will have to select a payment method, decide on pricing, create a signup page, and more.

Check out our ultimate guide on how to create a WordPress membership site for all the details.

In this tutorial, we will show you how to use MemberPress to create a premium subscription and then determine which content can only be accessed after paying for a membership.

Let’s start by setting up a new membership plan for your subscribers. To create a membership level, you need to go to the MemberPress » Memberships page and click on the ‘Add New’ button at the top.

Adding membership levels to your WordPress website

You will need to give the plan a name and decide on the cost of the content and the billing type.

We will create a one-time lifetime payment, but you could choose one of the regular subscription options.

Creating multiple membership levels in WordPress

After that, you need to scroll down to the membership options meta box below the post editor.

This is where you can customize permissions and membership options for this particular plan.

The Membership Options settings

If you need more than one membership plan, then go ahead and repeat this process.

When you are finished, you can click on the ‘Publish’ button on the right of the screen to make it available.

Publishing a membership level with a free trial

The next step is to select which content is available to each membership plan on your website. MemberPress makes it easy to control access using Rules.

You can set up your rules by visiting the MemberPress » Rules page and clicking on the ‘Add New’ button at the top.

Adding a new rule to your WordPress membership site

The rule edit page allows you to select different conditions and associate them with a membership plan.

For example, we can protect all content with the ‘Gold’ tag so that it’s available only to members of our Gold plan.

Setup rules conditions

Below the rules editor, you will see the content drip and expiration options. These let you release content gradually and make it unavailable after a period of time.

If you’d like all the content to be available as soon as users sign up and remain available without expiring, then you should leave these boxes unchecked.

Content drip and expiration settings

You can repeat the process to create more rules as needed for your membership site.

Once you are satisfied, go ahead and click on the ‘Save Rule’ button on the right to save your rule settings.

Click save rule button

Now, all we need to do is to add our locked content.

In our example, we add the ‘gold’ tag to the posts we want only Premium members to be able to access.

Adding tag to post

Next, scroll down to the ‘MemberPress Unauthorized Access’ meta box below the post editor.

Here, you can select what logged-out users (non-members) will see when they reach this content.

Unauthorized access section

You can see the content lock-in action by visiting your WordPress site.

For example, on our demo site, someone who is not a premium member will see the pricing page when they access the locked content.

View pricing page for locked content

Premium members will be able to see the content when they subscribe to a plan and log in to your WordPress site.

Bonus: How to Use Content Locking to Grow Your Business

Now that you know how to add content locking to your site, let’s look at some use cases for growing your email list.

1. Lock Content for Registered Users

If you are running a membership site and want to make money from your WordPress blog, then you can lock exclusive content for registered users.

For example, you could lock content like interviews, online courses, videos, podcast episodes, cheat sheets, and other content for registered users.

Content locking preview

This way, users will have to subscribe to a premium plan and submit their email address to access the exclusive content.

2. Restrict Content Based on User Roles

You can also use content locking to restrict access to specific pages and sections on your site. This is really useful if you run a multi-author website and don’t want writers or contributors to view certain pages.

Similarly, you can restrict content based on user roles on a membership site. For instance, only users with a subscriber user role can view the video section on your site or access online courses.

3. Offer Content Upgrades to Visitors

Content upgrades are pieces of bonus content that users can unlock by signing up for your email list.

You can use content locking to offer free upgrades to visitors and encourage them to join your newsletter. This way, users will have an incentive to get bonus content while you will get more subscribers.

Offer Content Upgrades

We hope this article helped you add content locking in WordPress. You may also want to learn the right way to create an email newsletter or check out our list of must-have WordPress plugins to grow your site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

19 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Chanakya Sahu says

    Hello admin, can we add content lock on videos?

    Like for example, there is an overlay of email subscription form on the video and when the user signs up for free, the video starts to play. I saw this in some website. I think it’s a great way to collect emails.

  3. Jiří Vaněk says

    This is a really interesting method to get, for example, people’s e-mail addresses for the newsletter. However, it’s probably a good idea to first think about what kind of content to put it in. E.g. divide premium content with this content locking and non-premium content. So that it doesn’t have the opposite effect as a result, that people are more likely to leave. For reflection.

  4. anne says

    Hello, Just bought OptinMonster and it seems it doesn’t have this function anymore? I can only put an inline post at the bottom of the article? I really need this function for my client’s website and I don’t know what to do now. Help, anyone?

    • WPBeginner Support says

      The function is still available. If you reach out to OptinMonster’s support they can assist you in setting it up.

      Admin

  5. Vignesh says

    Hi is it possible to create folders in WordPress pages ?

    Instead of posts displaying directly on the screen, I need a folder in which the posts can be added.

  6. John says

    This Plugin starts from $49/year for the basic version. Not exactly aimed at beginners, is it?

    Do you ever review Plugins that DON’T pay you a commission?

  7. Ankit Agarwal says

    This is awesome. But I have two points for your thoughts.

    1. Optin Monster is great but it costs something. If I am not using Optin Monster ( or any other paid service), is there any way to do this with a free option?

    2. You said ” If it’s done correctly” Can you please make a separate post ( or a content upgrade on this one) about what ways can it go wrong. I am sure your readers will be really curious to do this correctly.

  8. Nergis Parikh says

    How can I add this to a site that is not using wordpress but some other custom cms? And can it be added to collect leads before allowing viewers to download specific pdfs only from the website?

  9. Alex says

    Great idea, but what about Restrict Content Pro? I used it for many clients and i really believe it’s great solution.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.