Using LD+JSON Schema to Enhance SEO for Blog Posts

Schema markup helps search engines understand your content by describing its primary purpose, in a machine-friendly way. The most recent, and in my opinion, the easiest to maintain, is ld+json, which is contained in a script tag, proving the search engines with the key data.

What does ld+json markup look like?

The best way to explain what ld+json markup looks like is with example code, based on the Article type. Below is the code for this post:

{
    "@context": "http://schema.org",
    "@type": "BlogPosting",
    "headline": "the post title",
    "datePublished": "the post date",
    "image": {
        "@type": "ImageObject",
        "url": "the post thumbnail"
    },
    "description" : "the post description/excerpt"
}

As you can see, this is super easy, so get marking up! But you may want to double-check that your post has a featured image and an excerpt, otherwise image.url and description will be empty. One easy way to overcome these is to check a thumbnail exists and use WordPress’s wp_trim_excert() to create an excerpt from the post’s content. Feel free to get in touch if you would a helping hand, as we’re seasoned WordPress developers.