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

by dejuan.watsica , in category: SEO , a month ago

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

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer


by vinnie , a month ago


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.