Is this a correct way of hiding a page from search engines?

Is this a correct way of hiding a page from search engines?

Loftop
Shopify Partner
12 0 1

I want to hide a whole theme from search engines, the theme name is qrcode, I used this code in theme.liquid

 

{% if template contains 'page.qrcode.json' %}
      <meta name="robots" content="noindex">
    {% endif %}

Here are some screenshots

obraz_2023-08-09_154304544.png

 

obraz_2023-08-09_154318731.png

 

Reply 1 (1)

pooja_d_92
Shopify Partner
132 16 19

Hello,

 

Please try this form:

<form action="{{ routes.search_url }}">
<input type="text"
placeholder="Search"
name="q"
value="{{ search.terms | escape }}"
/>
<input type="hidden" name="type" value="product" />
<input type="submit" value="Search" />
</form>

 

Thanks

Pooja Devi