diff --git a/includes/class-wc-structured-data.php b/includes/class-wc-structured-data.php index f4e57e7ab4c..e22e8c63d32 100644 --- a/includes/class-wc-structured-data.php +++ b/includes/class-wc-structured-data.php @@ -312,6 +312,11 @@ class WC_Structured_Data { } } + // Check we have required data. + if ( empty( $markup['aggregateRating'] ) && empty( $markup['offers'] ) && empty( $markup['review'] ) ) { + return; + } + $this->set_data( apply_filters( 'woocommerce_structured_data_product', $markup, $product ) ); }