Skip to content

itemReviewed schema is invalid #86

@bowser845

Description

@bowser845

Google has tightened up the criteria for the types of schema that Review can be applied to:

https://webmasters.googleblog.com/2019/09/making-review-rich-results-more-helpful.html

As such, the markup for 'Item Review / itemReviewed' in the plugin is kicking out an error as it has 'Thing' applied to it.

I have edited the plugin on my own sites to set the itemType to Product as my reviews are for products.

It would be good if the plugin had secondary options for setting the type of Item Review to match Google's new criteria. In my case I cannot use the current option of Product within the plugin as this does not mark it up as a review of a product.

To fix the issue for the time being I have replaced this code on line 92:

$review .= "<div class='snippet-data'> <span itemprop='itemReviewed'>".esc_attr($item )."</span></div>";

With this:

$review .= "<div class='snippet-data'> <span itemprop='itemReviewed' itemscope itemtype='http://schema.org/Product'><span itemprop='name'>".esc_attr($item )."</span></span></div>"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions