Hey guys,
I’ve been following this topic closely and here is what I decided. I will make more in-depth tutorials on how to implement the Event and the SoftwareApplication structured data types, probably during the weekend.
The HowTo schema is very complicated – I could make a completely new plugin just to support that schema type. But to be honest I think many of you don’t understand what that schema type requires. If you don’t have a set of steps to successfully complete a task in your posts then that’s not the schema type you are looking for. The set of steps has to be defined in the structured data with texts and optionally images, videos etc. You can read more about the HowTo schema type here: https://developers.google.com/search/docs/data-types/how-to So, for know this schema type will not be added to the plugin.
Some of you recommended legacy markups which still show rich snippets, most likely only because they are used so rarely that Google hasn’t removed their support yet. I’m not planning to add such markups to the plugin, not least because they don’t seem to be available in JSON-LD. Nevertheless, while testing different markups I did manage to get the complex-rating (recommended by @feedough on the second page) working. Below is the implementation:
function my_complex_rating_structured_data( $structuredData ) {
$voteCount = rmp_get_vote_count();
$rating = rmp_get_avg_rating();
$img = get_the_post_thumbnail_url();
$name = get_the_title();
$structuredData = '
<div style="display:none;" class="hreview-aggregate">
<div class="item">
<span class="fn">' . $name . '</span>
</div>
<div class="rating">
<span title="' . $rating . ' of 5 stars">
<span class="average">
' . $rating . '
</span> /
<span class="best">
5
</span>
</span>
(<span class="count">' . $voteCount . '</span>)
</div>
</div>
';
return $structuredData;
}
add_filter( 'rmp_structured_data', 'my_complex_rating_structured_data' );
Note that this type is available only in microdata format and thus the snippet above hides the output with display:none. I have no idea if this in any way violates the guidelines.
Thanks to all who shared you implementations here on the forum.
Regards,
Blaz
-
This reply was modified 5 years, 1 month ago by Blaz K..