When we have some membership related requirements, we need to use a membership software like MemberPress or S2 Member. These are complete solution for a business membership website. But sometime we just need to hide or show some content for registered users and same goes for unregistered users.

For example, you want to show an application form only for unregistered users and want registered WordPress away from that form. Most of the membership plugins offer just to hide content from unregistered user. Barely we find a hack that let us hide a piece of content from registered users.

In this post, I am going to introduce you with an amazing, light weight and easy to use plugin, with the help of which you can show / hide specific post content not only from the registered and unregistered users but also specify content for a particular user role.

For instance, you have written some text that should be visible for editors but not for administrators or any other role, you can do it adding a shortcode that works for editor role.

Content Locker WordPress

So let’s find out how the plugin works.

Private content plugin

Private content is a free plugin available on WordPress repository. You can install it straight from your WordPress plugin dashboard.

Just install and activate the plugin and start using the shortcodes provided by the plugin.

Below is the complete list of short codes that works with the plugin

Content for only administrator[private role=”administrator”]Content goes here[/private]

Content for only administrator and editor[private role=”editor”]Content goes here[/private]

Content for only administrator and editor and author[private role=”author”]Content goes here[/private]

Content for only administrator, editor, author and contributor[private role=”contributor”]Content goes here[/private]

Content for only administrator, editor, author, contributor and subscriber [private role=”subscriber”]Content goes here[/private]

 

Content for editor only[private role=”editor-only”]Content goes here[/private]

Content for author only[private role=”author-only”]Content goes here[/private]

Content for contributor only[private role=”contributor-only”]Content goes here[/private]

Content for subscriber only[private role=”subscriber-only”]Content goes here[/private]

Content for visitor only[private role=”visitor-only”]Content goes here[/private]

You can also specify text for a specific registered user with the help of the following shortcode;

Content for a specific user –  [private role=”none” recipient=”login-name”]Content for one specific registered user[/private]

You can display alternative text for users who are not allowed to see the content. For instance if you have wrapped some content with a shortcode for authors, you can also add alternative text for non-authors as given below

[private role=”author-only” alt=”content for non-authors.”]Content for authors only[/private]

If you are looking for a full featured membership WordPress plugin, consider S2 Member and MemberPress.

How to use the plugin

  • First install and activate the plugin
  • Go to the desired post and then edit it
  • For example you want to hide an image for registered users then use the following code – [private role=”visitor-only”]IMAGE[/private]

DOWNLOAD THE PLUGIN

[emaillocker id=2873]Download the Plugin[/emaillocker]