To main content

WP-JsonLD: Wordpress-Plugin for data

Published by Benjamin Marwell on

WP-JsonLD is a new plugin, which was written by me. It is available on Github at bmhm/wp-jsonld verfügbar and already contains a fully functional wordpress plugin. For short: It will include machine readable data using the format specification Json-LD into your Wordpress HTML output.

This post will describe the internals of this plugin and why you might want to use it.

What WP-JsonLD will do for you

The wordpress plugin WP-JsonLD will insert data into your wordpress page, invisible to the reader. It uses the format specification json-ld for this matter, and the context from This way it provides the contents of the wordpress post in a machine readable format, without taking up too much space or time for rendering. There is an advantage in having linked data posted as json: Google (and other search engines) will extract more information from these data compared to parsing just the text of this site.

[caption id="attachment_5995" align="aligncenter" width="622"]WP-JsonLD und Googles ErgebnisWP-JsonLD and Googles output[/caption]

Microdata and RDFa will be obsolet by now. They are hard to include afterwards into your html code. The new json-ld standard on the other hand is uncomplicated and will not modify existing data. This makes debugging and various other things more easy.

Results of WP-JsonLD: SEO

To be honest, I cannot make claims that Google will rank your page higher when using my plugin. In fact, my other jsonld-plugin for webtrees didn't change much either. Anyway it is a good step to take, because Yoast SEO has similar functions -- but they are incomplete. WP-SEO by Yoast will only insert little jsonlp (Json Linked Data) into the head section on your front page. But you don't want this to happen, because it will work nicely in the footer as well without blocking loading times.

So there is only one specification left to mention: You can retrieve the jsonld-data only. Just send a corresponding http accept header. This is not implemented in WP-JsonLD yet, but will be.

The plugin output

The plugin will insert the following code for this page

<script type="application/ld+json" src="">{
    "headline": "Samstag`s Aushilfe gesucht!",
    "datePublished": "2015-12-29 16:37:39",
    "url": "",
    "commentCount": 0,
    "dateModified": "2015-12-29 12:51:43",
    "articleSection": "Deppenleerzeichen",
    "author": {
        "email": "",
        "name": "Benjamin",
        "url": "",
        "@type": "Person",
        "@id": ""
    "@context": "",
    "@type": "Article",
    "@id": "",
    "publisher": {
        "name": "Der Deppenakzent",
        "logo": {
            "url": "",
            "width": null,
            "height": null,
            "image": null,
            "caption": null,
            "contentUrl": null,
            "@type": "ImageObject",
            "@id": ""
        "legalName": "Der Deppenakzent",
        "@type": "Organization",
        "@id": "",
        "url": ""
    "image": {
        "url": "",
        "width": 1024,
        "height": 722,
        "image": "",
        "caption": "Bild <a href=\"\" rel=\"external\">Deppenapostroph</a> von <b>*MarS</b> auf Lizenz: <a href=\"\" rel=\"external nofollow\">CC BY-NC-SA 2.0</a>.",
        "contentUrl": "",
        "@type": "ImageObject",
        "@id": ""
    "mainEntityOfPage": {
        "@type": "Article",
        "@id": ""

I'd like to mention that the src -attribute will be ignored anyway, but it is much easier to debug and faster to cache the output. If you'd like to test it yourself, try the Structured Data Testing Tool by Google and enter any url or just start typing json-ld.

Download WP-JsonLD

Currently, you can download releases on, or just type git clone  while in your wordpress plugin directory.

The plugin will be also made available as a wp-jsonld.