The common way to create Schema markup for WooCommerce product variations in the past has been to create multiple Schema offers for a product – one offer per variation. Unfortunately, the Google merchant crawler has always been very unreliable when reading offers, sometimes being able to read product offers, and sometimes not. Even now, after Google added merchant validation to their Rich Results Test tool, it does not guarantee that the Google merchant crawler will be able to read Schema markup as predicted by Google’s test tool.
Some structured data plugins have attempted to work around the limitations of Google merchant’s crawler by offering different Schema markup when query arguments for variation attributes are present in the URL. WooCommerce creates a single webpage for a product (like WordPress does for a single Post or Page), and javascript is used to adjust the information displayed based on URL query arguments for variation attributes – but there still is only one singular HTML webpage for a product. Some structured data plugins break this single product webpage by adjusting the Schema markup to include only the variation offer when URL query arguments are present. This has some serious drawbacks as the WooCommerce product webpage can no longer be cached, the canonical URL value is now invalid (ie. points to the main product page, which has different markup), and search engines traditionally ignore query arguments, which means they are seeing different markup for the same URLs. Breaking the WooCommerce product webpage might help fix Google merchant’s limitations, but it does so at the expense of search engine ranking.
So, how do we preserve the single webpage for a WooCommerce product with variations?
Google merchant recently added the (still pending) Schema inProductGroupWithID property to their Item group ID [item_group_id] documentation, in what appears to be an effort to fix their unreliable support for multiple offers – by simply doing away with supporting multiple offers. :-) The Schema inProductGroupWithID property is part of a more complex Schema markup structure for products, with a (still pending) Schema ProductGroup type having multiple variants in its (still pending) Schema hasVariant property.
WPSSO Core Standard and Premium v15 add support for both Schema types; the Schema Product type with offers, and the (still pending) Schema ProductGroup type with variants. The Schema Product type is the default for WooCommerce simple products, and the Schema ProductGroup type is the default for variable products. You can change the default Schema type in the Document SSO metabox when editing a product, but the default Schema types are suggested for the best results in Google search and Google merchant.
You can download the WPSSO Core Standard edition here and the WPSSO Google Merchant Feed XML add-on here (suggested to provide a complete product feed for Google’s Merchant Center).