How to hide the Shopify product price and stock info from Google?

How to hide the Shopify product price and stock info from Google?

Uniqwa_C
Excursionist
21 0 15

While allowing rich snippets is good for SEO, we have member-only products and don’t want to disclose information about price and stock to non-members. Therefore, we hide those details from the product page with customer accounts and customer tag. However Google search reveals rich snippets including the member only price and stock levels.

Can someone suggest how we can remove all shopify product pricing and stock levels from Google crawling? 

Thanks 🙌

Rich Snippet.png

Replies 16 (16)

drakedev
Shopify Partner
703 152 244

That really depends how structured meta data for products are implemented on your website. Are you using an app, or is that feature embedded inside the theme you are using?

If my answer was helpful click Like.
If the problem is solved remember to click Accept Solution.
Shopify/Shopify Plus custom development and support: You can hire me for simple and/or complex tasks.
Uniqwa_C
Excursionist
21 0 15

The feature where price is hidden from public and only available to logged in customers is done with code customization {% if customer %} 

Screen Shot 2021-08-18 at 2.10.42 pm.png

We are using both Shopify price tiers (compare price shown to public, price only to customers with login and "trade" tag). As prices are available in Shopify, google can crawl it even though on the site itself customers have to log in to view it.  

How do we stop Google from crawling this info/displaying it in rich snippets? 

drakedev
Shopify Partner
703 152 244

You need to edit the code of your product template

Remove the lines that contains itemprop availability and price, if customer is not logged in.

If you use Google Rich Results Test and use for example the product page you show in your example you'll see that it detects

<meta itemprop="price" content="1999">
<link itemprop="availability" href="http://schema.org/InStock">

You will receive a warning in Google Search for those products, about missing fields.

If my answer was helpful click Like.
If the problem is solved remember to click Accept Solution.
Shopify/Shopify Plus custom development and support: You can hire me for simple and/or complex tasks.
Uniqwa_C
Excursionist
21 0 15

Thank you drakedev 🙌 we will give this a go 

EcoffinsMark
Visitor
3 0 0

Hi, did this resolve the issue for you? I've removed this and the price from the product structured data but it is still appearing after a google recrawl. This is driving me mad! Why can't Shopify come up with a solution for this for wholesalers?

MadOXX
Visitor
2 0 0

Did Shopify get back to you with an answer?

EcoffinsMark
Visitor
3 0 0
Yes, but they just referred me to a discussion forum that I had already seen with ideas I had already tried. They've kind of shrugged their shoulders a bit. Although the price doesn't show on the site initially, it is still present in the code as part of the json feed for an additional app. It needs to be in the code somewhere for the different site functionality to work, prices when you are logged in and for any tax calculations etc.

I think Google is seeing that info and doing its own thing to show it. We're looking to see how we stop it. Google are a bit naughty and don't always play by the rules, they've even started rewriting meta data if they think they can do a better job than the existing.
MadOXX
Visitor
2 0 0

Thanks for getting back. Do you propose any solutions? Maybe hiring third-party Shopify experts that understand this issue and can solve for it?

Hiltonfrost
New Member
4 0 0

Does anyone have a solution that actually works?

SYSO
Shopify Partner
1 0 0

It seems impossible, since I've contacted at least six app builders and no one had a clear answer. I'm still looking for the solution to hide stock and price in the Google search results. Anyone?!!

PurePro
Visitor
2 0 0

Did you have any luck with a solution? We are facing the same problem

EcoffinsMark
Visitor
3 0 0

Quick update: we removed price from Schema.org Microdata, the variables that google accepts to show on google. We also had to remove Size dropdown on the product page for non-logged in users. This seems to have got it for the while, however it has created other bugs to resolve - the price plus VAT has disappeared from the product pages now!

 

bryan76
Navigator
406 8 87

if you have to be logged in to see the price you can also hide it from Google in main-product.liquid with this code:

 

I was able to get it done with a simple:
{% if customer %}
"price" : {{ variant.price | divided_by: 100.00 | json }},
{%- endif -%}
 
the "price" : {{ variant.price | divided_by: 100.00 | json }}, is already in the schema.   
 
you can check what is visible in the js to Google (or anyone who wants to check) here: https://validator.schema.org/
 
hiding the price from the product page uses a the same if customer code around:
{%- render 'price',
product: product,
use_variant: true,
show_badges: true,
price_class: 'price--large'
-%}
 
I use an else to write make a little block where the price was like this:
<div style="border: 1px solid #ccc; padding: 12px 15px; font-size: 15px" class="b2c-sign-in">
Please <a href="/account/login" style="color: #000; text-decoration: underline">sign in</a> or <a href="/pages/contact" style="color: #000; text-decoration: underline">contact us</a> for Pricing or to Request a Quote
</div>
 
I hope this helps some folks since I looked through Shopify Discussion threads throughout the past 4 year and couldn't find answer to this.   I thank the Reddit community for helping me as my suppliers were getting angry about the price showing on Google
Uniqwa_C
Excursionist
21 0 15

Thank you - will try this. We had previously edited out the lines as seen here, which worked for about 1 year before recent, prices were back in Google results. Google crawl css edits.png

bryan76
Navigator
406 8 87

it has been so long I do not know if this is working or not.  it is not as important to me now as I no longer cary the only brand that made it an issue.  an issue I have is that I have prices hidden on product page for some items yet they show up on the collections page.  I have not tried very hard to tackle this as it's not critical.  let me know your results as google will fire back errors if the structured data isn't correct correct 

GemPages
Shopify Partner
5625 1262 1279

Hello @Uniqwa_C 

I would like to give you the recommendation to support you.

 

- You can try using the app Klevu Search. It will help show/hide Price in Search Results.

- You can also control the visibility of your store products using the "Hide Out of Stock Items" option, which utilizes the default Shopify out-of-stock inventory model. You can visit the URL https://shopify-v2.sparq.ai/theme/general/ and update the setting as shown in the following screenshot : https://prnt.sc/0lOj-3sKmPyn

Once enabled, it will hide items for which Shopify reports out-of-stock quantity.

 

I hope the above is useful to you.
Best regards,
GemPages Support Team

GemPages - Build any high-converting store pages for any business


- If you find my reply helpful, please hit Like and Mark as Solution
- Get connected: App Store | Blog | Community | Help Center