How to hide the Login button?

Last modified by Marius Dumitru Florea on 2025/02/21

XWiki 16.10.0+

XWiki has a login button on the top navigation bar, that you may want to hide (for example if you want to show a non-loggable website to your users).

loginButton.png

The register button can easily be removed by removing the guest user permission to Register.

The Log-in button needs a more specific action:

  • Log in as an admin of your wiki
  • Go to: Administer Wiki > Look & Feel > Themes
  • Look for the Skin section and click on the Customize button
  • From the skin page click on the "Edit this skin" link
  • Look for the "Overridden templates" section on the skin edit page
  • Add a new overriding template named "loginLink.vm"
  • Copy the original content (make sure you change the version in the URL to match your XWiki version) and paste it in the Content text area
  • Modify the content to meet your needs. For instance, you could show the login link only when some specific request parameter is present:
    #if ($xcontext.user == 'XWiki.XWikiGuest' && !$xcontext.inactiveUserReference && $request.showLoginLink == 'true')
      ...
    #end
  • Save your changes.

From then on, the login button in the navbar will not be shown anymore on your wiki (unless you add ?showLoginLink=true to your URL, in case you applied the change suggested above).

1732029368722-340.png

Get Connected