We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Exclude channel from search results

How Do I?

deswork's avatar
deswork
122 posts
about 4 years ago
deswork's avatar deswork

I have a simple search form and I’m looking to exclude a channel from displaying in the results page even if the search term is relevant.

I’ve added the channel not parameter to the simple seach but results from the asset channel are been returned on the results page.

Am I missing something?

{exp:search:simple_form channel="not asset" status="Protected|open" search_in="entries" result_page="bca/search-results"}
      <div class="mb-3">
       <label for="keywords" class="form-label">Search</label>
       <input type="text" class="form-control mb-2" name="keywords" id="keywords" placeholder="Search term">
       <input type="submit" value="Search" class="btn btn-bca-blue">
      </div>
      {/exp:search:simple_form}

Thanks Wayne.

       
Rob Allen's avatar
Rob Allen
3,105 posts
about 4 years ago
Rob Allen's avatar Rob Allen

You can specify what channels to include or exclude as a parameter in your search tag.

For example you can exclude the “blog” channel but include news and events channels:

{exp:search:simple_form channel="not blog|news|events" ...}
       
deswork's avatar
deswork
122 posts
about 4 years ago
deswork's avatar deswork

No, even if I set the channel, in this case about and search it shows results for entries outside of the about channel.

{exp:search:simple_form channel="about"}
       
Sobral's avatar
Sobral
87 posts
about 4 years ago
Sobral's avatar Sobral

I think this bug is already fixed, @deswork.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.