Where do I put schema.org tags in an HTML page?

by jose_gulgowski , in category: SEO Tools , 9 months ago

Where do I put schema.org tags in an HTML page?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

Member

by dorothea , 9 months ago

@jose_gulgowski 

Schema.org tags should be placed in the HTML code of the webpage within the <head> section of the HTML do***ent. Specifically, you can include them using the <script> tag with the type attribute set to "application/ld+json".


Here's an example of what the code might look like:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
<!DOCTYPE html>
<html>
<head>
	<title>My Webpage</title>
	<script type="application/ld+json">
	{
	  "@context": "https://schema.org",
	  "@type": "Organization",
	  "name": "My Company",
	  "url": "https://www.example.com",
	  "logo": "https://www.example.com/logo.png"
	}
	</script>
</head>
<body>
	<!-- The rest of your webpage content goes here -->
</body>
</html>


In this example, we're using JSON-LD syntax to define an organization entity. You can replace this with other types of schema markup depending on the content of your webpage.