` in a `head` section do?", "text": "<p>I got this link but didn't understand well. Saw:</p> <pre class="prettyprint"><code>&lt;script type="application/ld+json"&gt; { "@context": "http://schema.org", "@type": "WebSite", "url": "http://website.com", "name": "wbs", "description": "Web Studio" } &lt;/script&gt; </code></pre> <p>in a source code.</p> <p>How a code snippet like above in my website header help me or my site?</p>", "answerCount": 2, "upvoteCount": 315, "dateCreated": "2016-07-30 06:01:03", "dateModified": "2022-10-06 00:57:11", "author": { "type": "Person", "name": "Asim K T" }, "acceptedAnswer": { "@type": "Answer", "text": "<p>In your example, the <code>script</code> element is used as data block, which contains JSON-LD (<code>type="application/ld+json"</code>).</p> <p>JSON-LD is a RDF serialization. It allows you to publish Linked Data (or structured data) using JSON. In your example, the vocabulary Schema.org is used (<code>"@context": "http://schema.org"</code>).</p> <p>This structured data can be used by any interested consumer. Prominent consumers are the search engines Bing, Google, Yahoo, and Yandex, which support structured data that uses the vocabulary Schema.org. One use case they have is displaying more details in their result snippets.</p> <p>Your example probably doesn’t lead to such an enhanced snippet. You have to check the search engine’s documentation if you want to know what features they offer and which structured data you have to provide for these. For example, Google uses the <code>WebSite</code> type (that’s used in your example) for their Sitelinks Search Box, but you would have to add a <code>potentialAction</code> in addition (for the search function).</p>", "upvoteCount": 103, "url": "https://exchangetuts.com/whats-a-script-typeapplicationldjsonjsonobjscript-in-a-head-section-do-1639542065662977#answer-1646909597904723", "dateCreated": "2022-10-04 10:57:11", "dateModified": "2022-10-06 00:57:11", "author": { "type": "Person", "name": "unor" } }, "suggestedAnswer": [ { "@type": "Answer", "text": "<p>It gives Google and other crawlers structured data about a website. This is used for rich snippets and knowledge graph panels among others. Have a look at this site for more information: https://developers.google.com/search/docs/guides/intro-structured-data</p>", "upvoteCount": 23, "url": "https://exchangetuts.com/whats-a-script-typeapplicationldjsonjsonobjscript-in-a-head-section-do-1639542065662977#answer-1646909597907223", "dateCreated": "2022-10-05 10:57:11", "dateModified": "2022-10-06 00:57:11", "author": { "type": "Person", "name": "Markus Lanthaler" } } ] } }
Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's a `<script type='application/ld+json'>{jsonObj}</script>` in a `head` section do?

I got this link but didn't understand well. Saw:

<script type="application/ld+json"> {     "@context": "http://schema.org",     "@type": "WebSite",     "url": "http://website.com",     "name": "wbs",     "description": "Web Studio" } </script> 

in a source code.

How a code snippet like above in my website header help me or my site?

like image 315
Asim K T Avatar asked Jul 30 '16 06:07

Asim K T


People also ask

What is application LD JSON?

It is an implementation format for structuring data analogous to Microdata and RDFa. Typically, in terms of SEO, JSON-LD is implemented leveraging the Schema.org vocabulary, a joint effort by Google, Bing, Yahoo!, and Yandex in 2011 to create a unified structured data vocabulary for the web.

Does Google use JSON-LD?

Google prefers JSON-LD for web content.

What is JSON-LD context?

JSON-LD provides JSON-LD contexts which enable JSON documents to use simple, locally-meaningful names, while still enabling the messages to be meaningful beyond the initial exchange partners. A JSON-LD message can be meaningful to anyone anywhere, even when mixed with other data.


2 Answers

In your example, the script element is used as data block, which contains JSON-LD (type="application/ld+json").

JSON-LD is a RDF serialization. It allows you to publish Linked Data (or structured data) using JSON. In your example, the vocabulary Schema.org is used ("@context": "http://schema.org").

This structured data can be used by any interested consumer. Prominent consumers are the search engines Bing, Google, Yahoo, and Yandex, which support structured data that uses the vocabulary Schema.org. One use case they have is displaying more details in their result snippets.

Your example probably doesn’t lead to such an enhanced snippet. You have to check the search engine’s documentation if you want to know what features they offer and which structured data you have to provide for these. For example, Google uses the WebSite type (that’s used in your example) for their Sitelinks Search Box, but you would have to add a potentialAction in addition (for the search function).

like image 103
unor Avatar answered Oct 06 '22 00:10

unor


It gives Google and other crawlers structured data about a website. This is used for rich snippets and knowledge graph panels among others. Have a look at this site for more information: https://developers.google.com/search/docs/guides/intro-structured-data

like image 23
Markus Lanthaler Avatar answered Oct 06 '22 00:10

Markus Lanthaler