Hide Login in Confluence Dashboard

Hi,

How do I hide just the login (at the top right hand corner) in Confluence Dashboard from anonymous users?

Thank you.

6 answers

1 accepted

This widget could not be displayed.

Hey Tet, I found the following Custom HTML from another Atlassian Answer that another person created:

 

This script works for the "Demonstration Space" (which has a spaceKey of "ds") that ships wiith Confluence

Browse to Confluence Admin | Look and Feel | Custom HTML

In At the end of the HEAD, paste:

<script>
  AJS.toInit(function($){
    if (AJS.params.spaceKey == 'ds') {
      $('#login-link,#browse-menu-link').parent().hide(); // Hide the login & browse menu
    }
  });
</script>

Then Save.

Change the 'ds' bit to whatever the spaceKey is for your space.

 

This widget could not be displayed.
Stephen Deutsch Community Champion Aug 13, 2015

This should work:

<script>
  AJS.toInit(function() {
    if (AJS.params.remoteUser == '') {
      AJS.$('#login-link').hide();
    }
  });
</script>

This is the one that worked for me

This widget could not be displayed.
Stephen Deutsch Community Champion Aug 12, 2015

The script that Guilherme linked to will block the login link for a particular space, but not from the dashboard.

This would probably work better:

<script>
  AJS.toInit(function($){
    if (document.location.href.indexOf("dashboard.action") !== -1) {
      $("#login-link").parent().hide(); // Hide the login menu
    }
  });
</script>
This widget could not be displayed.

Hi Stephen,

 

I tried your method but it does not work.  Actually I also tried this script which is working but it hides the whole menu bar from anonymous users:

<script>

  AJS.toInit(function() {

  if (AJS.params.remoteuser == '') {

  AJS.$('header').hide();

}

});

</script>

 

How do I modify this script to just hide the login button in the menu bar.  I would like to leave the rest (eg. quick search textbox) visible.

Thank you

This widget could not be displayed.

Thank you!  It works!

This widget could not be displayed.

This worked for me as well! 

Thanks! Perfect solve.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published Jul 30, 2018 in Confluence

How Manon Soubies-Camy uses Confluence + Trello to organize webinar notes and her knitting stash

@Manon Soubies-Camy is an engineer who has been an avid Atlassian user since 2014. She helps companies of all sizes transform the way they work with the Atlassian stack, including Jira and Confl...

863 views 8 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you