exclude a user from people directory

Hi all,

Does anyone know how to exclude a user from the "people directory". 

It would be useful to not display "admin" for example.



4 answers

1 accepted

0 votes
Accepted answer
Davin Studer Community Champion Sep 11, 2014

There is no easy way to do it. There aren't any options you can set to exclude them ... lame as it is. I had to hijack the search page to do this.

What I did for this is I created some JavaScript that I included in the "At the end of BODY" section in the custom HTML. This script will run on each page at this point since it is included on every page. So, I do a check in the script first thing to see if I am on the people directory page. If so, then I hide the default search form and create my own that has the inputs I want with a submit button. When the submit button is clicked it generates the search string that will give me the people I want to look up, but I also exclude in the search string the people I don't want to show. The I populate the default search field that is hidden with the generated string and programatically click the default, now hidden, button.

I also change the "People" link in the top header bar to have a default search that removes the unwanted account(s). Some thing like this ...


What this is doing is returning every one from A to ZZZZ (which should be everyone) except anything with admin in it. The reason for this is when you click the people link it will show you everyone at first ... including the people you don't want to see. So, to avoid these people showing I just start the people search process with a default search string that removes them.

Thanks for your answer! I have instead opted to rename my admin account to something more relevant to users (ie. Service Desk). This also makes sure it is not the first user in the people directory so it is less conspicuous. Thank you for your help though.

Hi Alicia, 

If you are using LDAP or AD, you can exclude users or groups of users with an LDAP query string filter

Its a little tricky, but this doc describes it pretty well. https://confluence.atlassian.com/display/CROWD/Restricting+LDAP+Scope+for+User+and+Group+Search

These "Crowd" fields are found in Confluence when configuring your LDAP User Directory (Admin > Users & Security > User Directories). Among other, you have to specify the LDAP schema and then your user object filter (or group object filter) like described in above link. This is especially useful if you have ex-employee or service accounts and you want to remove them from counting against your Confluence license (and also will fall out of the People Directory). 

Hope that helps maybe down the line as you go.


Davin Studer Community Champion Dec 18, 2014

This does remove them from the directory,but also removes them from the system. I think the question was about having someone who can log in, but does not show in the people directory ... such as a service account.

I do not consider admin a "service account". A "service account" is an account often found in ADs/LDAPs to perform a service without a human. An "admin" account I think always has a user associated with it. However, point taken. An admin with that name shown in the People DIrectory does not make sense, and yes, filters removes from system. So all depends on what they are after in the People Directory.

You could write a custom plugin to extract certain users information from the Lucene search index. This would remove them out of the directory.

Perhaps add the users to a particular group, then remove group members.This is similar to a "Do Not Index" plugin I wrote recently which removes pages based on their label

You can alter the template of the people directory which is located at:  confluence/confluence/users/peopledirectory-results.vm

Just wrap an if-statement around the code that outputs the profile macro to check the username or which group the user belongs to.

In this case I hide all users inside the group confluence-administrators:

#if (!$userAccessor.hasMembership('confluence-administrators', $person))
  $helper.renderConfluenceMacro("{profile:user=%s|mode=people-directory}", $person)

Davin Studer Community Champion Jun 25, 2018

The one downside of this approach is that programatically those users are not actually removed from the results ... they are just skipped over when displaying. So, your results page(s) could have less than 50 results displayed.

that one does not work for me....

Screenshot from 2018-07-20 10-44-49.png

I've added such code, but confluence-administrators members still are displayed at People directory


is there any other working solution ?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

793 views 33 5
Join discussion

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