Personalized checkout and custom promotions with Shopify Scripts
I've been fixing errors shown in Google Search Console and now there is one critical error left, which is the duplicate field "Price". So far I tested our website and get these errors.
1. Critical errors - duplicate field "price" (in "offers").
2. Warnings - priceCurrency (THB (The property priceCurrency is not recognised by the schema (e.g. schema.org) for an object of type Product.), and price (149 (The property price is not recognised by the schema (e.g. schema.org) for an object of type Product).
Where can I look in order to find out where those duplicate prices are coming from? I would like to share the codes but don't know where to look. and is there a fix to remove them?
The codes with the warning sign says:
<meta itemprop="priceCurrency" content="THB">
<meta itemprop="price" content="149">
Under offers, there is no warnings, and THB and the prices seem to be validated.
Many thanks!
Solved! Go to the solution
This is an accepted solution.
As expected, it's a complex answer. Your theme is using an old version of structured data called microdata. This basically spreads the structured data through your files, making it very difficult to fix without really looking at the code and understanding what it's doing. Not something I can do from here.
IMPORTANT NOTE: If you are not a developer, I do not recommend this part unless you are willing to take the risk. If done incorrectly, you can alter what's visually shown on your theme.
If you look for the itemprop="price" code shown on the right side of the screenshot, you should see it twice in your theme. You want to remove one of these.
In the end, microdata is often outdated and your product's structured data is not up to par with Google's expectations for both Rich Results and Merchant Center. The best advice I can give is to remove your theme-provided microdata and use an app like JSON-LD for SEO that can provide it for you and keep it up to date. You can add the code from Shopify as well, but this too isn't always up to date and you depend on Shopify to maintain it for you. Plus it's only product data, not other data such as organization, website, article, etc.
<script type="application/ld+json">
{{ product | structured_data }}
</script>
You should find the code in main-product.liquid, just above the {% Schema %}.
If you're not confident making changes to the structured data we offer a service for that, alternatively you can replace it with Shopify's structured_data filter which will auto generate the information, and is good enough for most applications.
<script type="application/ld+json">
{{ product | structured_data }}
</script>
Hope this helps
Simon
thank you, I will look into it first, I am interested in learning a bit more about how Shopify works!
Hey @Schnitzelchen
Are you willing to share the URL where the error is occurring? It's hard to advise on this, but when you see a duplicate field, it's because the structured data is provided multiple times. So you'd need to know where it's being provided and which ones are editable.
Your theme uses microdata, making it much harder to "fix" in one fell swoop without understanding where the data is coming from. Though microdata is valid, it's spread throughout your code making it harder to edit, vs JSON-LD which is under one script tag.
So if you can share the URL, I can try to provide more specific advice.
hi there again! thank you for your insights, really appreciate it. for example, the errors are shown here, there are 55 same errors in total in our website https://healtholicious.com/products/grass-fed-ghee-brown-butter-caramel-ghee
This is an accepted solution.
As expected, it's a complex answer. Your theme is using an old version of structured data called microdata. This basically spreads the structured data through your files, making it very difficult to fix without really looking at the code and understanding what it's doing. Not something I can do from here.
IMPORTANT NOTE: If you are not a developer, I do not recommend this part unless you are willing to take the risk. If done incorrectly, you can alter what's visually shown on your theme.
If you look for the itemprop="price" code shown on the right side of the screenshot, you should see it twice in your theme. You want to remove one of these.
In the end, microdata is often outdated and your product's structured data is not up to par with Google's expectations for both Rich Results and Merchant Center. The best advice I can give is to remove your theme-provided microdata and use an app like JSON-LD for SEO that can provide it for you and keep it up to date. You can add the code from Shopify as well, but this too isn't always up to date and you depend on Shopify to maintain it for you. Plus it's only product data, not other data such as organization, website, article, etc.
<script type="application/ld+json">
{{ product | structured_data }}
</script>
Thank you for such a detailed clarification, Ilana, that makes total sense. I saw you wrote some articles in your website regards these issues, let me take some time to digest it so that I understand what is needed to be done to fix it before getting someone to help. still trying to get in touch with the guy who implemented the change.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024