DNN 7.2.0 introduces a new feature, which includes user data in search (even for upgraded websites), i.e. entering "host" in search will provide you with a link to host user profile in default website.
While this might be a great feature for sites hosting communities, most of the websites of my clients just include a few admin users, who don't want to get exposed their data in website search. Other sites do provide user accounts for newsletter signup and don't want to expose this data via site search (in Germany, site owners may even get fined, if the user didn't consent to his data being published).
The easiest option to exclude all users from is disabling user data from being included in search results via UI:
- Go to search results page (either in Admin > Pages or by entering a term into the search box
- Switch to edit mode and enter module settings of search results
- in tab "Search Results Settings", open drop down list for setting "Results Scope for Content Type(s)"
- unselect "users"
Unfortunately, this will not stop users from being indexed (by an expensive stored procedure), i.e. their data copied from the database into the search index files. If you want to prevent this, run the following statement from Host > SQL:
ALTER PROCEDURE {databaseOwner}[{objectQualifier}GetAvailableUsersForIndex]
@PortalId INT ,
@StartDate DATETIME ,
@startUserId INT = 0,
@numberOfUsers INT = 500
AS
BEGIN
SELECT UserID,
DisplayName,
'' AS FirstName,
'' AS PropertyName ,
'' AS PropertyValue,
0 AS Visibility,
Null AS ExtendedVisibility,
Convert (DateTime, 0) AS ModifiedTime
FROM {databaseOwner}[{objectQualifier}Users]
WHERE userId = 0
END
Version for DNN 7.3.2 and above:
ALTER PROCEDURE {databaseOwner}[{objectQualifier}GetAvailableUsersForIndex]
@PortalId INT ,
@StartDate DATETIME ,
@startUserId INT = 0,
@numberOfUsers INT = 500
AS
BEGIN
SELECT UserID,
DisplayName,
Convert (DateTime, 0) AS LastModifiedOnDate,
'' AS PropertyName,
'' AS PropertyValue
FROM {databaseOwner}[{objectQualifier}Users]
WHERE userId = 0
END
(btw: thanks to Vicenç Masanas, for the great overhaul of this module).
If you now re-index your site (in Admin > Search Admin, by pressing "Re-Index Content", all user data will be excluded from the index.
PS: I am well aware that NSA might not appreciate this hint...