How to Set up Login and Logout Links in Joomla

How to Set up Login and Logout Links in Joomla

A Joomlashack member was on our site and saw that the menu link "Login" was automatically replaced by "Logout" once someone had logged in.

In this tutorial, I'm going to show you how to create a Login menu item that only appears to users that aren't signed in. Once they sign in, they'll get a Logout menu item instead. 


Step #1. Create the Login link

First, let's create the Login.

  • Go to Menus > your menu > Add New Menu Item
How to Set up Login and Logout Links in Joomla
  • Enter a Menu Title.
  • Select the Menu Item Type.
  • Choose Users > Login Form.
  • Set "Access" to "Guest"
  • Click "Save & New".

Guest access will make it so that it only appears to non-logged-in users. If for some reason your site doesn't have Guest access, you can use this tutorial to create it.


Step #2. Create the Logout link

Next, let's create the Logout link.

  • Create a new menu item.
  • Enter a Menu Title.
  • Select the Menu Item Type.
  •  Choose Users > Logout.
  • Switch "Access" to "Registered".
  • Click "Save & Close".

Step #3. Test the links

Finally, let's test to make sure we got everything right.

Here are some things to check for:

  • Does the "Login" appear when logged out?
  • Does the "Logout" appear when logged in? Does it appear when logged in with another account of a different access level? If not, you may need to adjust the Access Control. We have a class on that at Joomla's Access Control Levels.

That's all there is to it. Congrats! Joomla makes it really easy to set up.