How to leverage structured data

Structured data helps the machines reading your site - search engines, AI models, and more - understand your content.

Adding structured data can enable search results that are more engaging to users and might encourage them to interact more with your website

Why add structured data to a page (Google)

The distribution (as of version 10.3.0) leverages the community contributed Schema.org metatag module and custom code to integrate structured data into many content types. You can test if your page is outputting structured data by using the Schema.org Validator or Google’s Rich Results Test

Once your site is updated, structured data will be automatically generated 🎉 with no additional work from content editors.

Articles

The Article (Layout Builder) content type implements the Article Schema as per Google’s Article structured data docs.

Articles have three options for the Type, which map to their appropriate Schema:

Customizing Articles

This mapping is set in code (y_lb_article_metatags_alter in y_lb_article.module), but all other settings are configurable via the Metatag configuration (/admin/config/search/metatag/node__article_lb).

Branches

The Branch content type implements the LocalBusiness Schema as per Google’s Local business structured data docs.

Any time the Branch Hours are updated, that content will also be reflected in the Structured Data that’s read by search engines.

Customizing Branches

The mapping is configurable in the Metatag configuration (/admin/config/search/metatag/node__branch). Hours configuration uses the Open Y Hours_metatag tokens.

FAQs

The Accordion Layout Builder Block has an option to implement the FAQPage Schema as per Google’s FAQ structured data docs.

If an Accordion section contains Frequently Asked Questions, check the FAQ? checkbox to output them as structured data.

Tips for writing good FAQ content:

  • Ensure the content contains individual sets of questions (“How old does my child need to be to swim at the YMCA?”) and answers (“The YMCA offers swim classes starting at age 3 and the pool is open to children of all ages with parental supervision”).
  • Only one FAQ should be added to a page. If more than one is added, only the first will be output to the structured data.

Customizing FAQs

Due to the complexity of the FAQ data, the structured data is managed entirely in code and is not customizable via the Drupal admin. If you need specific customizations, please post your ideas in Slack or suggest them on the Roadmap for the core team to discuss and implement.