Hiding People from People Search

Introduction

This all started as a request from a client to hide only certain users from the people search. I’ve decided on this route because the management interface already exists to update user profiles and it would be very little work to add a user profile property, get it crawled and use that as the filter in the people search results webpart. Below I will explain how I was able to accomplish this in Office 365 but the same would work for a SharePoint 2013 on prem.

How To

In Office 365 -> SharePoint Administration -> User Profiles


Click “Manage User Properties” under the People Group


Click “New Property”


Set the following properties (everything else leave be)

Name: HideFromPeopleSearch

Display Name: HideFromPeopleSearch

Policy Setting: Optional

Default Privacy Settings: Everyone

Search Settings -> Alias [checked]

-> Indexed [checked]





Click “OK”

Wait some amount of time for O365 to index the User Profiles and retrieve this new field.

** for on prem users – kick off a FULL search crawl of your people content source**

You’ll know it’s ready when you can find the new Property in the Search Schema, Crawled Properties.

From the Admin Center click “search” in the left hand menu


Click “Manage Search Schema”


Click “Crawled Properties”


Enter “Hide” in the Crawled properties search box, then click the green arrow


You will see the property appear in the search results when the property has been successfully crawled.


Next you will need to create a “Managed Property”, Click On the “Managed Properties” link


Click “New Managed Property”


Enter the following information:

Property Name: HideFromPeopleSearch

Type: Text

Queryable: Checked

Retrieveable: Checked

Add Property Mapping -> People:HideFromPeopleSearch





Click Add A Mapping

Enter “Hide” in the search box, click the Find button


Select “People:HideFromPeopleSearch”, click the OK button


Leave all the other properties as-is, click OK


You will now have to wait until Office 365 runs a full crawl on your site for the property to become available in search. When this action takes place is unknown. (I’ve head 4 hours)

** for on prem users – kick off a FULL search crawl of your site content source**

Next go to the people search page

Edit the page and Edit the Web Part Properties of the People Search Core Results


Click Change Query


In the Property Filter drop down select –Show all managed properties–


Select HideFromPeopleSearch


Select “Not equals” then “Manual Value”

Enter “True” for the Manual Value

Next Click Add property filter


Click OK


Click OK in the People Search Core Results, Web Part Properties pane


Save, Check-In & Publish your page – All Set!

To manage users it’s as easy as using the User Profile Service Application, searching for a user’s profile and checking a box to save. Watch the video if you are note sure about that – http://screencast.com/t/5VGSLCt5N

Remember it won’t be instantly removed – it will take a crawl of the people source for those changes to make it to the site!!!

Advertisements

2 thoughts on “Hiding People from People Search

    • You have to flag the users you want to remove somehow this would pull them from the results all together. If you wrote and javascript you could hide users also but it would mess with other things such as the result count. It could say 10 results showing on the page but the javascript might be hiding them. I think that would be weird.

Comments are closed.