Home / Admin / Remove AggregateRating and Reviews Schema
Duplicate Snippet

Embed Snippet on Your Site

Remove AggregateRating and Reviews Schema

This filter code removes the AggregateRating and Reviews Schemas

100+
Code Preview
php
<?php
add_filter( 'aioseo_schema_output', 'product_schema_aggregate_reviews' );
function product_schema_aggregate_reviews( $schema ) {
	foreach ( $schema as &$schemaItem ) {
		if ( 'Product' === $schemaItem['@type'] ) {
			unset ($schemaItem['aggregateRating']);
			unset ($schemaItem['review']);
		}
	}
	return $schema;
}

Comments

Add a Comment