Mobile app version of vmapp.org
Login or Join
Lee4591628

: AggregateRating not showing in Google's rich snippet testing tool I tried using the AggregateRating and used the code below. The values of $aggregate_rating and $total_reviews is not empty, and

@Lee4591628

Posted in: #GoogleRichSnippetsTool #Php #RichSnippets #SchemaOrg #Wordpress

I tried using the AggregateRating and used the code below. The values of $aggregate_rating and $total_reviews is not empty, and tried printing its value.

Now I added the code inside my WordPress post, and checked the preview on Google's rich snippet testing tool. AggregateRating is not showing.

<div itemscope="" itemtype="http://schema.org/AutoRepair">
<strong><span itemprop="name">GMD Auto Shop</span></strong>
[php]
echo "<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">". $aggregate_rating . " </span> stars for <span itemprop="reviewCount">" .
$total_reviews . "</span></div>reviews.";
[/php]
<span itemprop="streetAddress">Kamagong Street, Lahug</span>
<div itemprop="address" itemscope="" itemtype="http://schema.org/PostalAddress"><span itemprop="addressLocality">Cebu City</span>,
<span itemprop="addressRegion"> Cebu</span>
<span itemprop="postalCode">6000</span>
</div>
Phone: <span itemprop="telephone">032-417-4700</span>
<div itemprop="geo" itemscope="" itemtype="http://schema.org/GeoCoordinates">Latitude: 40 deg 44 min 54.36 sec N
Longitude: 123° 54.037'
<meta itemprop="latitude" content="40.75" />
<meta itemprop="longitude" content="54.98" />
</div>
</div>

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Lee4591628

1 Comments

Sorted by latest first Latest Oldest Best

 

@Si4351233

@lordzden your PHP as Stephen points out is invalid. Your echo should look like

<?php
$aggregate_rating = '6.5';
$total_reviews = '24';

echo '<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><span itemprop="ratingValue">'. $aggregate_rating .'</span> stars for <span itemprop="reviewCount">'. $total_reviews . '</span></div>reviews';
?>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme