Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

itemReviewed schema is invalid #86

Open
bowser845 opened this issue Sep 18, 2019 · 0 comments
Open

itemReviewed schema is invalid #86

bowser845 opened this issue Sep 18, 2019 · 0 comments

Comments

@bowser845
Copy link

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>"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant