WordPress Content Restriction Shortcodes - ProfilePress

Content Restriction Shortcodes

The Content Restriction shortcodes let you restrict access to some or all of your content to users that are either logged in or logged out.

This allows you to restrict access to certain parts of your content by using shortcodes. There are two ways to use the shortcode

Hiding Contents from Logged-Out/Guest Users

When you want to show content to only users that are logged in, wrap the content with the following shortcode

[pp-logged-users]content to hide here[/pp-logged-users]

This will hide the content to all users that are NOT logged in. Only users that are logged in will see the content.

Hiding Content From Logged-in Users

When you want to show content to only users that are NOT logged in, wrap the content with the following shortcode

[pp-non-logged-users]content to hide here[/pp-non-logged-users]

This will hide the content from all users that are logged in. Only users that are not logged in will see the content.

 

That’s all.