Where to put schema.org tags in html page?

by naomi_cronin , in category: SEO , 6 months ago

Where to put schema.org tags in html page?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by percy_bauch , 6 months ago

@naomi_cronin 

Schema.org tags can be placed in various parts of an HTML page, depending on the specific type of content you want to markup. Here are some common locations:

  1. Within the head section: Place the overall schema.org type for the entire page within the element, using the
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<head>
  <script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "WebPage",
    "name": "Page Title",
    "description": "Page Description"
  }
  </script>
</head>


  1. Within specific elements: Markup specific content elements with schema.org tags nested within their respective HTML tags. For example, if you have a blog post, you might surround the blog post content with schema.org tags. For a blog post, you might use the Article schema.org type:
1
2
3
<article itemprop="mainEntity" itemscope itemtype="https://schema.org/Article">
  <!-- Here goes the actual content of the blog post -->
</article>


  1. Within specific attributes: Schema.org tags can also be placed within specific HTML attributes that relate to the content being marked up. For example, if you have an image, you can use the image property of the Article schema.org type:
1
2
3
4
<article itemscope itemtype="https://schema.org/Article">
  <img itemprop="image" src="image.jpg" alt="Image Description">
  <!-- Rest of the article content -->
</article>


Remember to consult the schema.org documentation for the specific type of content you wish to markup in order to ensure you are using the appropriate tags.