If you want to add structured data (via Schema.org spec) to your WordPress site, there are lots of options. There are so many options in fact that it’s hard to figure out which is right for you.
Note: This is an abbreviated article that is simply a summary of research and notes I took for making my own WordPress schema decision, hence the informal style.
Free Version / No paid version, but Yoast Pro is required, $99/year
It is possible to build schema yourself and it’s not very difficult since JSON-LD is a simple format.
The problem with this is that the spec is very specific and the format is quite fragile, so the chance of offering broken or incomplete schema is very high. Additionally, schema is something that goes across all of your content, which means are you inevitably going to have edge cases. While building a one-size-fits-all schema tool is no challenge, building something for every scenario and then tracking changes over time seems like it’s not worth the headache.
If I were to build this functionality into one of my sites I’d use Advanced Custom Fields (both new fields and existing fields) to hold the data for the schema that isn’t in WordPress by default (for example, I’d need to build in a star rating, but not a title or featured image). I’d then build the skeleton of the JSON+LD in my templates head (taking into account all the schema types) and then populate the JSON with my ACF values.
This would be simple enough until I had articles where I didn’t want schema or where the schema would need to vary, as there would need to be a logic layer which would add greatly to the complexity of the build. It is because of this that I would recommend the free version of the Schema & Structured Data for WP plugin, as it’s basically what I would build (as in, it’s based on custom fields), but the plugin handles all the logic!
Sal Cangeloso November 9th, 2019
Posted In: Web Development