This project is not covered by Drupal’s security advisory policy.

This project extends Drupal's Metatag module to display vocabulary information as JSON LD in the head of web pages.

The Metatag module is used to define and store the values, and to handle token replacements for the values. Metatag module also provides a nice system of overrides, so you can define default values for all content types, override the node defaults for a particular content type, or even override everything else to provide specific values for an individual node.

This module defines metatag groups that map to types, and metatag tags for items, then steps in before the values are rendered as metatags, pulls the values out of the header created by Metatag, and instead renders them as JSON LD when the page is displayed.

For instance, the code in the head might end up looking like this:

<script type="application/ld+json">{
    "@context": "",
    "@graph": [
            "@type": "Article",
            "description": "Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Donec sollicitudin molestie malesuada. Donec sollicitudin molestie malesuada. Donec rutrum congue leo eget malesuada. Nulla quis lorem ut libero malesuada feugiat. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui.",
            "datePublished": "2009-11-30T13:04:01-0600",
            "dateModified": "2017-05-17T19:02:01-0500",
            "headline": "Curabitur arcu erat]",
            "author": {
                "@type": "Person",
                "name": "Minney Mouse",
                "sameAs": ""
            "publisher": {
                "@type": "Organization",
                "name": "",
                "sameAs": "",
                "logo": {
                    "@type": "ImageObject",
                    "url": "",
                    "width": "600",
                    "height": "60"
            "mainEntityOfPage": {
                "@type": "WebPage",
                "@id": ""

Since the list is huge, and growing, this module only provides a small subset of those values. But it is designed to be extensible. There is an included module, Article Example, that shows how other modules can add more values to the Article type that is already defined, or add new types (groups) with any number of their own fields.

The module includes a base group class and several base tag classes that can be extended. Many items are simple key/value pairs that require nothing more than extending the base class and giving them their own ids. Some are more complex, like Person and Org, and they collect multiple values and serialize the results. The included is an example of a complex element that can't be represented with string or token values and is computed when the page is rendered.

For more information and to test the results:

Supporting organizations: 

Project Information