Place Multiple Objects Inside of an Array Within a Single JSON-LD Script Tag

Programmer writing programming code script on the virtual screen.

To make the story short, I want my Schema.org declarations in my site to load as one (1) and not three (3) different snippets of JavaScript. Because for me, I find them as repetitive declarations wherein you are opening a new <script> tag for each Schema.org declaration. Another reason why I want to load as one is to improve my site's speed for Search Engine Optimization (SEO) purposes (I don't even know what I'm talking about LOL), it's what's on my mind that I want to achieve. I thought it was not possible until I found a perfect solution after a few days of searching the internet.

So if you want to try it also, here's how to place multiple objects inside of an array within a single application/json-ld script tag. It was commented by Jeff Jack to Will Hattman's post entitled How to Combine Multiple Schema.org Itemtype Declarations in a Single Script.

[
{
"@context”:”http://schema.org/",
"url":”https://www.example.com/",
…
},
{
"@context":"http://schema.org/",
"url":"https://www.isentress.com/",
…
},
{
"@context":"http://schema.org/",
"url":"https://www.isentress.com/",
…
}
]

I tried it and tested using https://developers.google.com/search/docs/advanced/structured-data and got no problems.






References:

  1. Hattman, W. (2017, March 22). How to combine multiple Schema.org Itemtype declarations in a single script. UpBuild. https://www.upbuild.io/blog/how-to-combine-multiple-schema-org-itemtype-declarations-in-a-single-script/
  2. Search Engine Land. (2020, April). Code html schema structured data [Photograph]. Retrieved from https://searchengineland.com/figz/wp-content/seloads/2020/04/code-html-schema-structured-data-SS_1089903890-1920x1080-1.jpg

Your voice matters. Discussions are moderated for civility before being published on the blog. Read my comment policy here.

Previous Post Next Post