How do I add structured data to Drupal?

The easiest way is to install the Schema.org Metatag module alongside the main Metatag module. It provides configuration for schema.org types like Article, Organization, Product, and Event.

Configure schema per content type through the Metatag interface. Map your fields to schema properties, and Drupal outputs JSON LD structured data in the page head automatically.

For more control, you can add custom JSON LD through a preprocess hook in your theme or a custom module. This is useful for complex schema types not covered by the Schema.org Metatag module. Test your structured data with Google’s Rich Results Test tool to make sure search engines can read it. Properly implemented structured data helps search engines understand your content and can enable rich snippets in search results, improving click through rates significantly.

Facebook
Twitter
LinkedIn
Pinterest