Shortcode to hide content from users that aren’t logged in

24 Jul 2011

Shortcode to hide content from users that aren’t logged in


A common issue many beginner WordPress users run into is blocking certain content from users that aren’t registered or logged in. Here is a short, simple solution in the form of a shortcode. Any content between the code block will only be output if the user has registered and logged in to their account.

You can paste this code into your functions.php to gain access to the WordPress shortcode.

And now the following can be put into any post, page, or widgetized area to filter who sees your content.

Leave a Reply

Your email address will not be published. Required fields are marked *