Can JSON-LD be used to mark up a blog post and a video on the same page?
 by Kristi Hagen

Can JSON-LD be used to mark up a blog post and a video on the same page?

  • My question is about structured data. If I have a blog post with a video, can I mark up the video as well as the blog post with JSON?

    Also, if I have a specific video on my website that appears on many of my site's pages, should I mark it up with JSON on all of the pages, or just one?

Answer:

Technically, the page is supposed to have a primary type, a MainEntity — and this gets a bit confusing when you have something like a video that helps describe the content of an article for example. If the video is not related to the page topic, then don't mark it up. With plugins, you pretty much have to use two separate markups; one for /Article for your blog post, and one for VideoObject.

Here are the testing tools for each...

Since getting a rich snippet for video is highly unlikely, we tend to focus on the Article Markup. However, to do it in a way that's technically correct, the code should be manually added to the header on the specific page, either by hand coding or by using a plugin like SOGO.

Then, the markup would look something like this...

{
"@context": "https://schema.org",
"@graph":
[{
"@type": "Article",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://google.com/article"
},
"headline": "Article headline",
"image": [
"https://example.com/photos/1x1/photo.jpg",
"https://example.com/photos/4x3/photo.jpg",
"https://example.com/photos/16x9/photo.jpg"
],
"datePublished": "2015-02-05T08:00:00+08:00",
"dateModified": "2015-02-05T09:20:00+08:00",
"author": {
"@type": "Person",
"name": "John Doe"
},
"publisher": {
"@type": "Organization",
"name": "Google",
"logo": {
"@type": "ImageObject",
"url": "https://google.com/logo.jpg"
}
},
"description": "A most ...

TO READ THE FULL ARTICLE