Where to put schema.org tags in an HTML page?

by dejuan.watsica , in category: SEO , 2 years ago

Where to put schema.org tags in an HTML page?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

2 answers

Member

by vinnie , 2 years ago

@dejuan.watsica 

Schema.org tags can be included in an HTML page using a number of methods, but the most common way is to add them as attributes to HTML tags. Here are some examples:

  1. Add schema.org tags to the head section of the HTML page:<html> <head> <script type="application/ld+json"> { "@context": "https://schema.org/", "@type": "Organization", "name": "Example Company", "url": "http://www.example.com", "logo": "http://www.example.com/logo.png", "contactPoint": { "@type": "ContactPoint", "telephone": "+1-888-555-5555", "contactType": "customer support" } } </script> </head> <body> <!-- page content --> </body> </html>
  2. Add schema.org tags to specific HTML elements:<div itemscope itemtype="https://schema.org/Person"> <h1><span itemprop="name">John Smith</span></h1> <p>Occupation: <span itemprop="jobTitle">Web Developer</span></p> <p>Email: <a href="mailto:john.smith@example.com" itemprop="email">john.smith@example.com</a></p> </div>
  3. Use the meta tag to provide additional information about the page:<head> <meta itemprop="name" content="Page Title"> <meta itemprop="description" content="Page description"> <meta itemprop="image" content="http://www.example.com/image.png"> </head>


It's important to note that the schema.org tags should be added in a way that is consistent with the HTML structure and doesn't interfere with the user experience. Additionally, it's a good practice to validate the schema.org tags using Google's Structured Data Testing Tool or other similar tools.

Member

by aniyah , a year ago

@dejuan.watsica 

Schema.org tags can be placed in various sections of an HTML page, depending on the specific data and use case. Here are some common locations:

  1. In the head section: The head section of an HTML page is a suitable place to define structured data using JSON-LD format. You can place the schema.org tags within a
  2. On specific HTML elements: To mark up specific content on a page, you can add schema.org attributes directly to corresponding HTML elements. For example, you can use the itemscope attribute to indicate the start of an item, and the itemprop attribute to specify the properties of the item. This is commonly used for marking up things like articles, events, person/contact information, products, etc.
  3. In meta tags: Some schema.org properties can be placed in meta tags within the head section. For example, you can use the meta tag with itemprop attribute to define the name, description, and image of a page.


Remember that the placement of schema.org tags should align with the structure and content of your HTML page. You should also ensure that the tags are valid and correctly specify the data you intend to mark up.