---
title: "The \"Logout\" menu item"
date: 2016-04-13
description: "When your visitors are logged into your Joomla website, you want to hide the \"login\" button and show a \"logout\" menu item."
author: "Jeroen Moolenschot"
---

# The "Logout" menu item

If your visitors have the option of logging in to your Joomla website, chances are you are using the login module. It is also possible to create a menu item with a link to the login form. Of course, you want to hide the "login" button and show a "logout" menu item to users who are already logged in. In this blog, I'll explain how to quickly set this up in Joomla 3.5 and above.

 
## The "login" menu item

 To start, you create a menu item to let visitors log in to your website.

 ![uitloggen login](https://www.joomill.com/images/blog/uitloggen-login.jpg)

 You choose the menu item type "Login form" and choose "Guest" under Access.

 Changing Access to Guest will hide this menu item from logged-in users.

 
## The "Logout" menu item for registered visitors

 Since the "log in" menu item is no longer visible to logged-in users, you also need to create a menu item to log out.

 ![uitloggen logout](https://www.joomill.com/images/blog/uitloggen-logout.jpg)

 You choose the menu item type "Logout" and choose "Registered" under Access.

 Changing Access to Registered ensures that this menu item is only shown to logged-in users.

 Note: The menu item "logout" does not refer to a form or page, but ensures that a user is immediately logged out when he clicks this button.

 
## Error message: "You are not authorised to view this page." fix

 As you can see, you get an error message after logging in: "You are not authorised to view this page" ( or in English "You are not authorised to view this resource." ).

 You get the message because the login page can no longer be viewed by registered users.

 To solve this, you need the menu item ID of your homepage. In my case, this is ID 101

 ![uitloggen menu items](https://www.joomill.com/images/blog/uitloggen-menu-items.jpg)

 Go back to the menu item "Login" and choose the 2nd tab "Options"

 Under Login reference, enter the link: index.php?Itemid=101 (Replace the number 101 with your own menu item ID)

 ![uitloggen menu item inlogverwijzing](https://www.joomill.com/images/blog/uitloggen-menu-item-inlogverwijzing.jpg)


## Custom Fields

**Call2Action Titel:** Do you need help setting up the menu on your own website?

