Answer the question
In order to leave comments, you need to log in
Errors in Google Search Konsole - "offers", "review", or "aggregateRating"?
Hi Experts
Just got a problem with Google Search Konsole - Set a value for one of the following data items: "offers", "review" or "aggregateRating".
I looked through the forum, found a topic with this problem - but all the solutions that are filed there do not help me in any way. (Screenshots 1 and 2)
Added code to the functions.php file to remove markup from product categories:
/**
* Remove the generated product schema markup from 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', '
Unfortunately, it did not help at all
. Then, on the forum, a second solution to this problem was also found:
add_filter( 'woocommerce_structured_data_review', 'filter_woocommerce_structured_data_review', 10, 2 );
function filter_woocommerce_structured_data_review( $markup, $comment ) {
global $product;
$markup['itemReviewed'] = array(
'@type' => 'Product',
'name' => get_the_title( $comment->comment_post_ID ),
'review' => array(
"@type"=> "Review" ,
'author' => array(
'@type' => 'Person',
'name' => get_comment_author( $comment->comment_ID ),
),
),
'ratingValue' => $product->get_average_rating(),
'reviewCount' => $product->get_review_count(),
),
);
return $markup;
}
The same situation. Plus, when I try to crawl the pages of the site after adding the code, I get the following message (see screenshot 3)
Help someone. I no longer know where to look for a solution to this problem
Link to the site - https://lemonbeauty.pl
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question