Re: Hide page (not product page) from site search & from Google

Solved

Hide page (not product page) from site search & from Google

hostilearth
Shopify Partner
39 0 6

Hi. Is there any way to hide a page, not a product page, from a site search and from Google search results that doesn't involve editing the theme code, such as what Shopify suggests here.

 

I'm aware I can hide the page from Google search console, so that's acceptable, but can I prevent a page from appearing in the site search results? I don't want to hide all pages, just particular pages.

 

Thank you.

Accepted Solution (1)

tim
Shopify Partner
3764 351 1384

This is an accepted solution.

You can set a metafield on the page object.

Similar to the following link, but that one talks about products, you need to do the same for pages.

https://community.shopify.com/c/shopify-discussions/hide-a-product-from-seo-and-from-the-shopify-fro... 

 

Here is the Shopify doc on this metafield https://shopify.dev/docs/apps/marketing/seo#step-2-hide-a-resource-from-search-engines-and-sitemaps 

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com

View solution in original post

Replies 4 (4)

PageFly-Oliver
Shopify Partner
878 190 180

Hi @hostilearth ,

example: if you want to disable the page with the URL is /pages/test then you can try this code by following these steps:

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file theme.liquid

Step 3: Paste the below code at the after <head> element of the file -> Save

 

{% if handle contains 'test' %}
<meta name="robots" content="noindex">
{% endif %}

 

example: if you want to disable the page with the URL /products/product1and /products/product2 then you can try this code by following these steps:

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file theme.liquid

Step 3: Paste the below code at the after <head> element of the file -> Save

 

{% if handle contains 'product1' or handle contains "product2" %}
<meta name="robots" content="noindex">
{% endif %}

 

Hope my solution works perfectly for you!

Best regards,

Oliver | PageFly

 

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.

hostilearth
Shopify Partner
39 0 6

 I specifically asked for a solution that didn't involve editing the theme code. I even linked to the solution you wrote out, saying I didn't want that solution. 

tim
Shopify Partner
3764 351 1384

This is an accepted solution.

You can set a metafield on the page object.

Similar to the following link, but that one talks about products, you need to do the same for pages.

https://community.shopify.com/c/shopify-discussions/hide-a-product-from-seo-and-from-the-shopify-fro... 

 

Here is the Shopify doc on this metafield https://shopify.dev/docs/apps/marketing/seo#step-2-hide-a-resource-from-search-engines-and-sitemaps 

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com
hostilearth
Shopify Partner
39 0 6

Thank you. I actually knew of this solution for products but didn't know I could use it for individual pages too.