New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Either offers review or aggregateRating should be specified #22896
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Chiming in here after the Slack dev chat :) From the research I've done on structured data in the past, structured data is designed to tell you about the information directly being presented on a page. Google notes this:
When generating structured data, WooCommerce includes a lot of data that's not shown in the product archive, so this data should not be present according to the guidelines. So what about limiting the structured data in archives -- should we do that or remove it completely? Google indicates in a few places that structured data should not be included in an archive that lists links to full listings.
(Emphasis mine on this last one.) So for WooCommerce archives, given they list all products and link out to full details pages, they should not be marked up. My vote is to remove this line for generated structured data on archives. |
@bekarice With kind regards, Amelia |
this should work, but I haven't tested it, so use with caution:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
As discussed in the Slack Dev Chat today removing the product schema markup from the Shop/Product Category pages seems to be the best solution. To do that you can add the following code to your themes function.php file. /**
* Remove the generated product schema markup from the Product Category and Shop pages.
*/
function wc_remove_product_schema_product_archive() {
remove_action( 'woocommerce_shop_loop', array( WC()->structured_data, 'generate_product_data' ), 10, 0 );
}
add_action( 'woocommerce_init', 'wc_remove_product_schema_product_archive' ); If you had previously added the other suggested snippets from I'm going to try and work on PR to fix the issue for a future release. Hope this helps. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Bro i have added brands and tested either. SEE YOURSELF
|
sigh you are using YITH brands. I don't even know if that adds schema. The WooCommerce.com does. Contact the developer. |
After re-reading the thread, the fix from @TimBHowe does indeed solve the problem. #22896 (comment) |
Check this one #22896 (comment). This could be the solution to your Brand error, as it does add the brand into the schema. I am not sure if you can see the actual comment via the link so I will paste the code. /**
/**
|
@mikejolley I have just received the Validation results from Google Search console and the latest update does NOT fix the errors. |
hi @mikejolley
thank you @TimBHowe , I test this but still got same result in google schema test tool . ;( I got more than 7000 errors and my ranking are dropping . I wish woocommerce / wordpress had stable release (with no major changes ) |
Same here, "Either "offers", "review", or "aggregateRating" should be specified" errors are not fixed after validation on category pages. Above solution don't work for me. |
@bondimedical3 @Laurentyzy double check that your theme doesn't add "schema" stuff. When I looked at the structured data of my product page, there I had two quite similar product-objects. one of them still had the error after upgrade but it wasn't woocommerce fault, it was in the theme. |
I am using the Storefront theme. To my knowledge it doesn't add any structured data. |
@mikejolley I take back what I said about the update. It appears the errors started to reduce yesterday in my Google Search Console. |
@bondimedical3 I think i'ts possible that you have 2 schema objects on your products. you have 7 warnings on some and 14 warnings on some which is an exact double, which is what you would see if some warnings are the same in one if two objects. If you paste one of your product URL in search console you will see the warnings, clic on the warnings and you will see where they stem from in the url. <script type="application/ld+json"> is probably woocommerce, and in my case i had "itemtype="http://schema.org/Product" on a div containing the product that produced error and warnings, this tag was added by my theme producer, it wasn't default. I later omitted this tag with positive results. |
@mikejolly Today I received an official email from Google that all my URLs had passed validation so in fact the latest update does fix the problem. No errors are showing in my Search Console. PS: All my structured data, reviews, ratings etc have also started to show in Google Search results again. |
I do not get it either, why is the product ID missing? Shouldn't this be added in the structured-data.php? If you do not have ratings and reviews these warnings should be there. But for all the other (except brand that is explained above) are unnatural. The ID, offerCount (I guess it's for variable products) pricevalid until and availability they shouldn't be there. |
For availability use this one (http) let me know if it fix it: |
Well the issue is that this line does exist in the update version of structured-data.php. Plus it doesn't say that the value is missing, what it says is that the value is invalid, so probably something wrong with the woocommerce code that sets in stock and outofstock.
|
instead of using https://schema.org/ use http://schema.org/ see if this fix the invalid error for availability in search console ?
|
with the http passed the initial validation so I will keep an eye on it, with the https it did not pass that validation, so it could be the reason for the availability issue. Do you have any ideas for the ID, offerCount and pricevaliduntil? |
For Brand this will fix it if you use yoast and your product category is your brand
offerCount and pricevaliduntil i don't have these two errors. try to revert to default theme and do a quick check if its your theme or not. Product ID its because of the gtin, MPN stuff. The route I am thinking is using Identifier_Exists Attribute with a value of FALSE. But I don't know how to write that code. I need to try and see if I can come up with something. If there is anyone who know how to write and implement this, please share. |
As I see it for the brand thingy because it's just a warning it doesn't worth it to download a plugin, create the brand and edit each and every product to assign a brand, for example I have about 200 products on the shop it's not worth it, I mean time wise, to edit each and every product just to remove a warning that doesn't even matter SEO wise. |
Very true @JohnDost errors have passed validation and warnings are merely warnings and should not require any extensive fiddling or plugins just to see a clean slate in Search Console. |
true, but we should fix what we can, if it worth it anyway. |
Hello sir, I have already applied this code on function.php file but it did work only for "shop" Pages, It didn't work for "Product Category Pages" |
hi, would someone be kind enough to explain or provide a tutorial or point me a to a link in which the answer is described in plain english how to fix this, i'm not a code guru i just need woocommerce to stop causing errors in google structured data testing tool. please help, anyone. |
All you need to do is update to the latest version. They fixed most of the warning except Brand. It is my understanding that Woocommerce has a plugin for Brands and that should take care of it. |
Hi, does anyone has any coding advice or recommendations on how to use the attribute as a Brand. |
I am not sure why you think it is fixed? I checked today and I am receiving several errors still receiving the following Warning Invalid value type for field "availability" |
This issue is resolved but as a few folks are still seeing problems I will summarize this one last time and lock comments to contributors.
Thanks |
Hello guys, I am sure you must be facing the same issue that I am updating in this thread. It is a recent Google Console Enhancement that throws a huge number of errors in the console. Take a look at screenshots in the end. I would be highly grateful if you guys help to fix this issue.
I am looking for a solution to fix this issue asap on my website. It affects almost all the products of my site. It will be great if you guys tell whether Woocommerce next updates gonna fix it for all store owners.
I have gone through this link #22842 that discusses the solution but probably not a solution just a discussion. After going through this link, i found a code that needs to be added in WOOCOMMERCE/INCLUDES/STRUCTURED DATA PHP file. I did that either and found it useless.
Will appreciate if the solution is listed down step by step so that everyone could utilize it and fix the issue. P.S most of the Woocommerce store owners are not developers and code friendly.
The text was updated successfully, but these errors were encountered: