Why does 'Card' search return 'Terms and Conditions' page?

Hello,

I searched my website for a value that a lot of my visitors search for (“Cards”) and I wanted to check if the singular value (“Card”) returns the same results as the plural one.

By that I came across something really really strange - one of the results is actually the website’s “Terms and Condition” page.

I attached a screenshot of this weird bug.
I’d appreciate any thought on why does it happen and how to fix it.

Thank you!

Is that term in the page? If so, seeing it in the results does make sense.

If you’re not sure how to check please add a link to that page so we can look at it.

If you wanted to stop that page from being returned in the storefront search results you can remove it by adding a special metafield. But lets understand (with that link) why it’s showing first.

Thank you for getting back to me.

You’re right, the word ‘card’ is indeed written in that page.
I haven’t realized that search results can be returned as a link to one of the website’s pages.

I did some tests and it seems every word that appears in any of the pages, get returned as a result.
How do I stop it from happening?? There’s quite a few words in my website’s pages that I can see my customers searching for, and I wouldn’t want a page to be a result, only products.

Thanks again!

Hi @asfanation ,

Please go to sections > header.liquid file, find ‘top-bar__search’ and change code:

Hope it helps!

1 Like

Thank you so much!

It worked!!

I appreciate it, thanks!

1 Like

Hello–

I am having the same issue as Asfanation. I have tried to follow the prescribed solution, but I do not have the required code in header.liquid (top-bar does not appear in the header file anywhere). I wonder if this is because of updates or if this is because of a different template (I am using Dawn).

After doing some exploring, I found main-search.liquid seems to have coding similar to the solution, but while I can read a lot of code, I do not feel comfortable enough to actually change the code without guidance.

Additionally, I am also new to the shopify framework, so if you need additional access or information, I am unsure how to provide that to you.