Support » Plugin: WooCommerce » How to add 'Missing microdata for condition' to Products.

  • Hi,

    We’ve received an error for “Missing microdata for condition” from the Google Merchant Centre for over 100 products.

    There is no schema code on the product pages for the condition of our products.

    Would you be able to advise how to add the condition of our products into the schema mark-up on pages in our Motorhome Parts and Accessories Shop.

    We’re unsure if this is a theme or a WooCommerce error and what’s the best way to go about this issue.


Viewing 11 replies - 16 through 26 (of 26 total)
  • Glad it helped. I am sure that there are a more elegant solution – but I could not find any.


    Ha, in this instance I’m not too worried about elegance ๐Ÿ™‚

    Thanks @larsbuur. The only thing I’d add to the hack is to make the URL https:

    'availability'  => '' . $stock = ( $product->is_in_stock() ? 'InStock' : 'OutOfStock' ),
    <strong>'itemCondition' => '',</strong>
    sku'           => $product->get_sku(),
    • This reply was modified 2 years, 4 months ago by  davidtrebacz.

    Thatยดs very interesting and valuable feedback @davidtrebacz. I certainly makes sense to point to a https resource to not have mixed content.

    Comparing and they do not seem to show the same content which seems very strange to me.

    Any idea why?

    No idea why. I can confirm that either pass Google Structured Data Testing tool.

    Well, i can confirm the code is working, on the http version after just over a day on both my merchant accounts I’ve dropped from 100% with missing microdata to 21% and 14% respectively. I expect them to fall further soon ๐Ÿ™‚


    WC 3.1 broke it again and can’t figure out how to add the schema for the item condition. Anyone know how?

    Not sure why this is not supported in base WC because the item condition is a very important declaration for any product offering and is throwing errors in adwords. ๐Ÿ™

    There is a bug in the initial release of WC 3.1 that turned off most micodata. That bug was reported by me here:

    The fix is:
    1. Wait for 3.1.1 to be released that will revert the change. The fix has been tested and committed, but no release date has been set.


    2. Change your includes/class-wc-structured-data.php to add the line that was accidently removed in the last release. Line 235$markup['offers'] = array( apply_filters( 'woocommerce_structured_data_product_offer', $markup_offer, $product ) );

    I did #2 and the microdata that was showing on the page before 3.1 is appearing again.

    • This reply was modified 2 years, 2 months ago by  davidtrebacz.


    But even after restoring default microdata using the updated github file, WC still does not add itemcondition. Any idea how to add it? I tried adding it in two spots and it did not output the schema for the item condition (being new).

    In my case all our products are new. I “solved” the item condition issue using the following code in functions.php in a child theme.

    function trebacz_add_offer_meta($markup_offer_trebacz) {
                    if ( ! isset( $product ) ) {
                            global $product;
                    if ( ! is_a( $product, 'WC_Product' ) ) {
                    if ( '' !== $product->get_price() ) {
                            $markup_offer_trebacz['itemCondition'] = '';
                            $markup_offer_trebacz['description'] = $product->get_short_description().' '.$product->get_description();
                    return $markup_offer_trebacz;

    This also concatenates the description meta data. The full question and solution are documented here:

    It’s much more complicated if you have a mixture of new and old items. If you have a more complicated solution, there is a very full featured charge plug-in here:

    It seems to address the full challenges of good product meta data in WooCommerce, but I have not tried it yet. My situation is just not that complicated yet.

    David, thank you so much for the code. It works and solved the problem! And thanks for the link to the schema plugin for WC. Seems like that offers a lot, probably much more than I knew even existed. LOL Thanks again for the help!

Viewing 11 replies - 16 through 26 (of 26 total)
  • The topic ‘How to add 'Missing microdata for condition' to Products.’ is closed to new replies.