Restricting search results

Answered

4 Comments

  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Hi Louise Moghaddam, :)

     

    you can try this, check article and then hide that from search results page:

    $(".results-list-item-link:contains(What are these sections and articles doing here?)").parent().parent().hide();

    $(".results-list-item-link:contains(What are sections?)").parent().parent().hide();

    $(".results-list-item-link:contains(What are categories?)").parent().parent().hide();

     

    Thanks

    0
  • Louise Moghaddam

    Thanks Ifra, sorry, I don't understand what you mean. Could you outline the exact steps please? Many thanks!

    0
  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Loiuse, the given code is 

    $(".results-list-item-link:contains(What are these sections and articles doing here?)").parent().parent().hide();

     

    This is my article title in the code which I want to hide on search results page:

    What are these sections and articles doing here?

     

     

    So, you only need to remove my article title and add your article title one by one in the code. I'm doing this for my three articles only.

    $(".results-list-item-link:contains(What are these sections and articles doing here?)").parent().parent().hide();

    $(".results-list-item-link:contains(What are sections?)").parent().parent().hide();

    $(".results-list-item-link:contains(What are categories?)").parent().parent().hide();

     

    1). What are these sections and articles doing here?

    2). What are sections?

    3). What are categories?

     

     

     

    you just add the given code to the scritp.js file and replace my article's title with yours which you wanna exclude.

    0
  • Louise Moghaddam

    It's worked! Thank you for helping Ifra, apologis for being such a luddite!!

    0

Please sign in to leave a comment.

Powered by Zendesk