-
Hello
I have Woocommerce running, and got an email from Google Search Console mentioning:
Missing Field “Sku”.This for a variable product, there are 2 variations and both have a field “article number (SKU) with a valid value. Looking on the frontend, when selecting the variation the screen notices this number correctly. However when inspecting the page source it is not included in the schema.
Removed the schema, saved again, but that’s not helping?
It´s also important to note that I do not have caching active.Is there a known reason for this behavior?
-
Hello,
Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.
You can fix the SKU and availability issue by applying the SKU code here:
If your schema data is not updating then it seems like an issue with the caching. However, you have stated already that you are not using cache on your site. Please contact your site host if they are using server-side caching. Purging the site cache should fix this issue.
Looking forward to helping you. Thank you.
Hi Azib,
It´s not a “simple product” but a “variabel product”.
Both variations have a SKU on their settings, and enough stock.Like mentioned: in the variations dropdown, on selecting the variabel product, my dynamic content correctly list the sku number. It is just not poping up in the schema created by rankmath.
Have a look at the provided url, you´ll see.
There is no caching active. So that´s not the cause either.
Hello,
We would love to help you further.
On checking the shared URL on Google’s Rich Results Test, I noticed two warning:
1. Missing Field “sku” (optional)
2. No global identifier provided (e.g. gtin, mpn, isbn) (optional)To fix the error of
No global identifier provided, please follow the steps from our Knowledge Base article here:
https://rankmath.com/kb/gtin-mpn-woocommerce/To fix the error of
Missing Field “sku”:As mentioned by my colleague earlier, please make sure all your products have their own SKU values, on each Product page whether it’s a simple/variable product.
That should fix the error.
Please let us know how that goes. Looking forward o helping you further.
Thank you
Hi Chandni
the global identifier is less of my problem as those products do not have this.
Like mentioned, each sub product has a sku configured, and is in stock.
You can see this visually when selecting a variation, on the left side it show the sku.There is no caching active, so there is little I can do from my end. The schema does not list the sku. I already removed and re-added the schema without succes.
I do not see this issue on my other variable products.Please provide a suggestion, I can not do more then what´s already done.
Hello,
We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.
It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
Thank you
I will set up a dev environment and come back to you ASAP.
Hello,
Sure, we are looking forward to debugging the issue further.
Looking forward to helping you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
I logged into your staging website’s admin area and upon investigating, I found that you only added the SKU to the variations of the product and left the main SKU field empty. You can have a look at the screenshot in the sensitive data section of this ticket.
We only add the main SKU of the product to the schema since for variable products, the only required property by Google is the price:
https://developers.google.com/search/docs/advanced/structured-data/productI added a demo SKU to the main SKU field of the product and then tested using Google’s Rich Results testing tool and the SKU warning was removed. I’ve added a screencast in the sensitive data section of this ticket.
Hope this helps.
Thank you.
Hello Rai,
that´s correct I do not add a “generic” SKU.The variations are the same product but with different print, thus with different SKU reference. So in that way adding a “generic” SKU is for SEO purposes not ideal.
First of all I´d need to create new SKU for non existing product, and next, Google would point to this SKU instead the ones available in the store.
Am I right that this is an item that still needs to be developed in Rank Math?
Obviously , I could create a separate product for 1 SKU instead of using variations but the content would be like say 90% the same, and Google would flag that as bad SEO practice (double content).
thanks
Hello,
As price is the only required property for variable products, we haven’t included SKUs of the variable products in the schema.
Also, directly adding multiple SKUs in the product schema would make the schema invalid.
You can add the SKU of the first/default variation of the product in the main SKU field.
Hope this helps.
Thank you.
Hello Prabhat,
how can we add this to the roadmap of Rank Math, as it is in my opinion a serieus flaw and missing feature for an SEO tool?
The suggestion you´ve made helps, for just one of the variable products on the page. So you´re missing gout on the others products thus loosing visibility.
Google states, that it is possible to add variations;
https://support.google.com/merchants/answer/6386198?hl=en#zippy=%2Cexample
=> check variant groups
"inProductGroupWithID": "44E01",Hello,
I tried to access your staging website but it is returning a connection timed out error. Here’s a screenshot: https://i.rankmath.com/aitjBh
Please try adding the below code to the website and see if the SKU of the variable products are added to the schema:
add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) { if ( ! is_product() ) { return $entity; } $product = wc_get_product( get_the_ID() ); if ( ! $product->is_type( 'variable' ) ) { return $entity; } $variations = $product->get_available_variations(); if ( ! empty( $variations ) ) { $offers = []; foreach ( $variations as $variation ) { $price_valid_until = get_post_meta( $variation['variation_id'], '_sale_price_dates_to', true ); $offers[] = [ '@type' => 'Offer', 'description' => strip_tags( $variation['variation_description'] ), 'price' => $variation['display_price'], 'priceCurrency' => get_woocommerce_currency(), 'availability' => $variation['is_in_stock'] ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock', 'itemCondition' => 'NewCondition', 'priceValidUntil' => $price_valid_until ? date_i18n( 'Y-m-d', $price_valid_until ) : '2025-12-31', 'url' => $product->get_permalink(), 'sku' => $variation['sku'], ]; } } $entity['offers'] = $offers; return $entity; } );Let us know how that goes.
Thank you.
Hello Prabhat
Yes, I am sorry for that, the staging server runs on a cloud compute, if wanted I’ll reactivate it?I test the code on production, and verified using google, however it doesn’t seems to be successful.
Hello,
It seems that the code is not producing any effect in the live website where it should have at least added all the offers, but they are still under a single aggregateOffer entry.
Could you please reactivate the staging website so we can implement the code there and make any adjustments if needed?
Looking forward to helping you.
The ticket ‘Missing field SKU for variable product’ is closed to new replies.