1

One of my clients have come up with a requirement to hide DispForm.aspx from the search results. I have researched on this a lot and come across an approach where we need to create a Query Rule and create a search query such that it would hide DispForm.aspx from the results. But it does not work for me.

I have tried with both these queries but none of them work for me.

{?{searchTerms} (-Title:DispForm.aspx)}

{?{searchTerms} (-Path:DispForm.aspx)}

Please guide.

1
  • Try it as {?{searchTerms} STS_ListItem} Commented Oct 10, 2018 at 7:09

1 Answer 1

1

The DispForm.aspx pages are for list items results. If you remove all DispForm.aspx results, all list items results will be removed.

Do you want to hide all list items form the search results and only show the files?

If yes, you can add IsDocument:"True" in your query.

For example:

{?{searchTerms} IsDocument:"True"}

Refer to: Using crawl rules to exclude Allitems.aspx, DispForm.aspx

Update:

If you want to hide view pages such as AllItems.aspx, Thumbnails.aspx, overview.aspx and so on from the search results, you can add the following to your query.

-contentclass:STS_List_*

Check this blog for more inforamtion:

https://www.techmikael.com/2014/11/tired-of-getting-allitemsaspx-hits-in.html

Another way, you can filer it out by query -filename:AllItems.aspx

2
  • Thank you @JoannaW_MSFT for this answer. My main aim to hide all the system pages from search results. Can you suggest a query for that, please? Commented Oct 10, 2018 at 9:29
  • If your meaning is hide the view page such as AllItems.aspx page, you can use "-contentclass:STS_List_*". I will update my answer. Commented Oct 10, 2018 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.