What data we expose as schema.org structured data
Schema.org is a community driven vocabulary (founded by Google, Microsoft et al) that allows us to add structured data to content.
Search engines such as Google and Bing use some schemas in order to process and present results in different ways. It’s also possible for other consumers such as Google Assistant to use these, so it’s about more than just conventional SEO.
We’ve implemented a few of these schemas on GOV.UK and have quite a bit of scope for going further.
Testing tools
You can inspect the structured data on a page by using the following tools:
The structured data testing tool is linked to from the GOV.UK browser extension to help exploration of our implementations.
The rich result testing tool is occasionally stricter in its requirements than the others because it checks that markup has everything required for Google to present a specially formatted result.
Schemas
We implement most of our schemas as part of the machine readable metadata component in GOV.UK publishing components. This allows us to create a template and share it across all the frontend applications.
Some other schemas are implemented directly in frontend apps. This is usually when:
- the schema is specialised to a particular GOV.UK content type
- or we’re starting to explore a new schema, and iterating using the gem is unnecessary overhead
It is possible to nest schemas within one another. In practice, we don’t often do this (preferring links to other content), but we may want to explore de-normalising things in future.
Article
The Article schema was the first to be implemented on GOV.UK. We tend to use it as a fallback when there isn’t a more specialised schema.
Google indicates that Article pages may be displayed as a rich result or in a carousel. In practice, I don’t think we’ve seen much difference over standard results for this. This is possibly because we only supply default images (such as the GOV.UK logo) with the default schema.
Breadcrumb
This is implemented within the Breadcrumb component. This is often shown in Google results, indicating the hierarchy of the site structure leading to the page.
Dataset
The Dataset schema is implemented on transparency, statistical data set, and statistics pages to expose a list of attachments. This is shown in the Google Dataset Search.
FAQPage
The FAQPage schema is implemented on guides, answers and a transaction.
They are intended for use on FAQ pages (which we famously don’t have), where there are a set of questions and answers. They are equally good (luckily for us) when used with titles and body markup, because Google can match the intent of the query with the body of the page without the need for actual questions.
Google presents these results in a special concertinaed treatment (see the GOV.UK answers for how to vote).
This is still quite new, and we’ve only user-tested it once. We found that people understood the difference between the FAQPage answer and the “People also ask” section on Google results. They tended to use the result as a signpost, or for orientation rather than expecting the answer to contain all the information.
Google also makes FAQPage content available as answers in Google assistant
We have a few different implementations of this right now, because it’s very new and we wanted to be able to explore its use in different document types. They are:
- The schema used on answers in GOV.UK publishing components
- The schema used on most guides in Government Frontend
- The schema used on “how to vote” also in Government Frontend
- The schema used for transactions in Frontend
We may consolidate these at some point!
GovernmentOrganization
We use the GovernmentOrganization schema on organisation pages.
GOV.UK is the source of info on UK government organisations (we have an API which is used to power the register).
NewsArticle
The NewsArticle schema is implemented (surprise surprise) on news articles.
This seems more effective in generating rich results than Article, probably because GOV.UK news articles tend to have relevant images associated with them.