A few days back, I got this warning message in the Google search console concerning my review of NameHero on my site WP-Tweaks:
This was a structured data error, which was surprising, considering I hadn’t changed any structured data for this particular page – at least nothing which could have led to this error. I’ve been using the same structured data review template for a long time and even wrote a tutorial about the best way to include a review schema on your site.
On digging deeper, I saw that the problem was coming from the following lines:
According to this, the “brand” field didn’t allow the “type” attribute to be a “Thing”. I don’t know how or why they changed this, or maybe the Google search console only now decided to include it as a warning. However, I’m pretty sure that it used to be correct because I based my structured data on the code provided by Google themselves. So it’s possible that Google was misinterpreting the standard from the very start.
Whatever the reason, I now had to fix the warning! So I checked out the schema documentation for the “Brand” field on https://schema.org/brand, and saw that there were now only two possible values:
I had to decide whether the NameHero I was promoting referred to a brand or an organization. Very often these two are the same thing, but not always since a single organization can have many brands. So for this case, I decided to go with “Brand”.
Fixing the JSON “Review” Structured Data
In my previous posts, I’ve recommended adding JSON structured data to WordPress using the “Custom HTML” block, as this gives you maximum control over the fields. If I was using a plugin, I might not have been able to make the change as easily since the plugin author would have had to update the code, push the release, and I would need to accept the update. But since we’re just using an ordinary block for the JSON code, making the change is trivial.
Just change “Thing” in the above screenshot to “Brand” in the appropriate place as shown here:
In the above example, I’m testing the changes using the Google Rich Results Testing tool, so I can paste the code for my HTML page directly into the editor and it will test the code. This way, I can make changes to my JSON and see if they work before I put them into production.
After changing “Thing” to “Brand”, you can see that the error disappears:
After making several of these changes to various products on my site, the errors vanish and Google is happy again ?
Schema Plugins vs Custom HTML Code Block
A huge reason why this problem is easy to solve is that I use the custom HTML code block in WordPress to write my review schema. As mentioned above, plugins come with a lot of extra baggage, which makes them inflexible. So while a plugin might have an easy interface to construct the structured data schema, it’s still better to do it manually with blocks of JSON code! This way, making changes just takes a few minutes of testing and you’re done.
I think that the custom HTML code block is one of the best innovations from the WordPress team compared to the old editor, and it has single-handedly changed my opinion of the Gutenberg update. Using it for writing JSON schema code is just one of the many uses.
I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!