Legacy Knowledge Base
Published Jul. 2, 2025

How to hide specific pages from search results using the Custom Filter Widget

Written By

Isaac Wilson

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • Is it possible to hide specific pages from search results?
  • For example, we have a site with Page A and Page B. Both pages need to remain public, but we only want Page B to show up in the results when users perform searches. 

Environment

  • DXP 7.2

Resolution


Important note: Instead of using the "Custom Filter" widget, it is also possible to make use of the "Search Blueprints" functionality, which allows you to hide the results with a specific tag using the "Hide Tagged Contents" element, for more information see:


 

It is possible to accomplish this end goal by leveraging the Custom Filter Widget's functionality

One set of possible steps to accomplish the end goal for the example described above would be:

  1. Add a "Search > Custom Filter" portlet to the search page where results will be displayed
  2. Select ⠇> Configuration for the Custom Filter, then configure and save the following values:
    1. Filter Field: assetTagNames
    2. Filter Value: tagforhiddenpages
    3. Filter Query Type: Match
    4. Occur: must_not
    5. [Optional]: To make the filter both invisible and un-editable to non-admin users, you can also select the "Invisible" and "Immutable" checkboxes
  3. Edit the SEO Categorization tags for Page A to include the tag tagforhiddenpages
  4. Once all changes are saved, any searches for "Page" will include a result for Page B, but will exclude the result for Page A

Additional Information

 

Did this article resolve your issue ?

Legacy Knowledge Base