I have hidden the price of my products unless the customer is logged in but the price still shows up in Google search results. I have simply used and If Else statement via Customer. I know that I can see the price data if I inspect the js of the page so it is still visible to anyone who knows how to do that and of course Google reads that data and posts it in their results.
Does anyone know how to hide the price from Google search results? some of my suppliers are not happy about this
Thank you!
1 Like
Hello @bryan76
Hereâs how you can implement this in Shopify:
1.From your Shopify admin, go to âOnline Storeâ and then click on âThemes.â
2.Locate the current theme youâre using and click on the âActionsâ button, then select âEdit code.â
3.In the theme editor, find the âtheme.liquidâ file, which is typically located in the âLayoutâ or âSectionsâ folder.
4.Open the âtheme.liquidâ file and locate the section. It should be near the top of the file.
5.Within the section, add the following code snippet:
{% if customer %}
{% endif %}
The above code checks if a customer is logged in. If a customer is logged in, it adds a noindex value to the robots meta tag, indicating to search engines not to index the page. As a result, the prices wonât appear in Google search results for logged-in customers.
6.Save the changes.
By adding the noindex value to the robots meta tag when a customer is logged in, you can prevent Google from displaying the price information in search results. However, please note that it may take some time for search engines to update their index and reflect these changes. Additionally, keep in mind that this approach is effective for logged-in customers only and doesnât provide complete protection against someone inspecting the page source or accessing it through other means.
Itâs worth noting that if your suppliers are concerned about the visibility of prices, you might want to consider discussing this issue with a Shopify expert or a web developer to explore more robust solutions for restricting price visibility based on specific requirements and restrictions.
I think you misunderstood. I 100% want the page indexed on Google but the price to not show up in Google search results as they are also hidden on the product page until the customer is logged in.
Your solution would remove the product pages from Google so that they would not be searchable and take my organic search results down to near zero
2 Likes
Same problem here! Solved it?
I am having the same problem: my prices which are meant to be hidden behind login, get shown to anyone when they search for my store using Google, especially in Image Search.
I also need to have a way to be discoverable on Google but not have pricing shown on Google. My clients are refusing to do business with us while the general public can see their pricing.
We are a two person business selling only to our countryâs funeral industry, which is very small.
1 Like
it is not exactly possible to hide the price from google search from a product page. the price is part of the structured data of the page code.
you could remove the product page from google search entirely.
you could try to create a non product page with all the product details with some sort of redirect to the product page when someone logs in. that would be a bit complex o get working properly and google search would not consider the non product page a product page ad might not give it the same visibility
Thank you for trying to help.
I do not have the time or budget to recreate every product page I have - ALL our items are one off, hand made, so every item has a unique listing.
It is already hard enough to get people to look at the site without them having to go through extra clicks to find the item they thought they were looking at.
Removing the pages from Google search means we would not be discoverable at all.
It really shouldnât be this complicated or hard to prevent Google displaying prices that are supposed to be hidden behind a sign-in.
As usual I am stuck between a rock and a hard place, with no reasonable solution.
if you did remove the line of code that shows the price in the structured data it would, for one be for the every product, but also would block the price from any advertising platforms, etc. and cause other issues.
it is not that it is comletely impossible, but that it is an feature of the page you need to have
Thanks Bryan.
How do I find out what is affected by that price field in the structured data. You say it is a âfeature of the page you need to haveâ
So far all it seems to do is tell Google my pricing even if I donât want that happening.
If I donât have any advertising platforms it shouldnât be a problem, but I need to determine the extent of itâs effect.
(I get so frustrated because I donât know what terms to search for, nor how to narrow results down to what is actually relevant)
for me I have the products on google shopping so I have to have all the data. that could be the same with other platforms connected to the products. it will also damage your seo.
you can try it. then have Google recrawl the pages.
I donât know what other problems it will cause. curious to see.
You can disable the price by editing this file in the theme code editor:
snippets/meta-tags.liquid
// Delete these lines or add extra logic to hide it from some products, or if not logged in etc.
{%- if request.page_type == âproductâ -%}
{%- endif -%}
how would changing the social sharing info for meta effects Google Search results?
the price, etc. that Google reads upon crawl is in the structured data. if the structured data remains Google will see it.