How to Use the Guest Feature in Joomla

How to Hide Content from Logged-In Users in Joomla

In this tutorial, we'll show how to hide content from logged-in Joomla users.

Why would you want to hide information from logged in users? The most common reason to do this that you want to encourage visitors to join the site. Then, if a visitor logs in, they no longer need to see the "join now!" content.

Fortunately, this is really easy to do with the "Guest" feature in Joomla. This guide will show you how to hide content without using any extensions.


Step #1. Getting set up

First, let's check that our site is set up correctly.

  • From the Administrator side, go to Users > Groups.
  • If you're using older versions of Joomla, you'll need to add a new "Guest" group that has "Public" as its parent. In Joomla 3, just verify that it's already there.
media_1386085113515.png
  • Go to Users > Access Levels.
  • In Joomla 2.5, you needed add a corresponding access level called "Guest". In Joomla 3, just verify that it's already there.
media_1386085256062.png
  • From the Users screen, click on the "Options" icon.
  • Look for the "Guest User Group" field and make sure it is set to "Guest".
media_1386085413456.png

Step #2. Add an article for guests

Let's create two articles that we can use for our testing:

  • Go to Content > Article Manager > Add New Article.
  • Add the title and content you want the non-logged-in users to see.
  • Set the "Access" option to "Guest".
  • Set "Featured" to "Yes", because we want this article on the home page.
  • Click "Save & New".
media_1386085730111.png

And now let's repeat this and create an article for our registered users.

  • Enter the title and body of article to be seen by your logged-in users.
  • Set the "Access" option to "Registered" and the "Featured" option to "Yes".
  • Then click "Save & Close" from the toolbar.
media_1386085970387.png

Finally, we'll create a new user to use for testing:

  • From Users->User Manager->Add New User
  • enter the login information of a new user: Name, Login Name, Password (twice) and email address.
  • Click on the Assigned User Groups and verify that it defaults to Registered.
  • Click Save & Close.
media_1386086239161.png

Step #3. Test Your Site

Now let's make sure everything is working correctly:

  • Browse to the public side of the site.
  • Notice that the home page has the article that was set to Public access.
media_1386086382517.png

Now we'll view the homepage while logged in.

  • Enter the User name and password of the user you created into the Login Form.
  • You'll now see the article on the home page that was set for Registered access, and NOT the article whose Access was Guest.

media_1386086576301.png

You can use this same process with menu items and modules for even more content hiding and showing. This technique is valuable for any site where you're encouraging people to join: Paid content sites, tutorial sites, dating sites, homeowner association sites, church membership sites. etc.