Jomatter

How to Add Schema Markup to HTML?

To add schema markup to an HTML page, insert structured data that describes the page or the entities on it. The most practical format for new implementations is JSON-LD, placed inside a <script type="application/ld+json"> element in the page source. Schema.org provides the vocabulary, such as Article, Product, Organization, BreadcrumbList, or LocalBusiness; the markup format determines how that vocabulary is embedded in HTML. Schema.org supports JSON-LD, Microdata, and RDFa.

1. Choose the correct schema type

Start with the actual purpose of the page. Do not choose a schema type simply because it sounds useful for SEO. A blog post can use Article or BlogPosting; a product page can use Product; an organization page can use Organization; and a breadcrumb trail can use BreadcrumbList.

Google requires structured data to follow its guidelines and accurately represent the content being marked up. Also, not every Schema.org type produces a Google rich result. Eligibility depends on the specific structured-data feature and its requirements.

2. Add JSON-LD to the HTML

Place the JSON-LD inside the HTML document. You can put it in the <head> or <body>. A basic article example looks like this:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>How to Add Schema Markup to HTML</title>

  <script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "Article",
    "@id": "https://example.com/how-to-add-schema-markup-to-html#article",
    "mainEntityOfPage": {
      "@type": "WebPage",
      "@id": "https://example.com/how-to-add-schema-markup-to-html"
    },
    "headline": "How to Add Schema Markup to HTML",
    "description": "A practical guide to adding schema markup to an HTML page.",
    "author": {
      "@type": "Person",
      "name": "Example Author",
      "url": "https://example.com/author/example-author"
    },
    "datePublished": "2026-09-30",
    "dateModified": "2026-09-30"
  }
  </script>
</head>
<body>
  <article>
    <h1>How to Add Schema Markup to HTML</h1>
    <p>Your visible article content goes here.</p>
  </article>
</body>
</html>

The application/ld+json script contains the structured data and does not appear as normal visible page content. Google uses JSON-LD in its structured-data documentation and examples.

3. Replace the example values

Never copy example data unchanged. Replace the URL, title, description, author, dates, images, prices, ratings, or other properties with the real values for the page.

Use the schema properties that match the entity you are describing. For example, a Product needs product-specific information, while an Article should describe the article. Do not add fake ratings, reviews, prices, authors, or other details just to make the markup appear richer. Google’s structured-data guidelines require accurate markup.

4. Match the markup to the page

A page can contain more than one structured-data object when multiple entities are genuinely present. For example, an article page can describe the article and its breadcrumb trail. Related entities can also be connected with properties such as @id, mainEntity, mainEntityOfPage, or other relationships defined by the vocabulary.

The goal is not to add the maximum amount of schema. The goal is to create a clear, accurate description of the page and its relevant entities.

5. Validate the schema markup

Before publishing, test the code. Google’s Rich Results Test can check whether structured data on a page can support Google rich-result features. It can test a public URL or code pasted directly into the tool. Fix syntax problems and required-property errors reported for the specific rich-result type you are targeting.

For Schema.org-specific validation, the Schema Markup Validator can parse JSON-LD, Microdata, and RDFa and identify syntax problems in Schema.org markup.

The page must also be accessible to Google when you expect it to be crawled. Google specifically identifies issues such as robots.txt blocking, noindex, and login restrictions as factors that can prevent proper processing.

6. Common mistakes to avoid

The most common problems are using the wrong @type, invalid JSON, missing quotation marks or commas, incorrect property names, fake data, and URLs that do not match the real page. Another mistake is assuming that valid schema automatically creates a rich result. Google decides whether and how eligible structured data is shown in Search.

Do not place normal HTML inside a JSON-LD object and expect it to work as JSON. Keep the JSON syntactically valid, use the Schema.org property names exactly, and make sure the structured data is consistent with the page.

Final answer

Adding schema markup to HTML is essentially a three-step process: choose the schema type that accurately represents the page, add the corresponding JSON-LD inside a <script type="application/ld+json"> element, and validate the result before and after publishing. JSON-LD is usually the simplest approach because it keeps structured data separate from the visible HTML while still describing the page for search engines and other applications.

You Will Also Like This

How To Create Multiple Web Pages In Html
How To Import An Html File Into Excel
How To Integrate WordPress Blog Into Html Website
How To Link A Css File To An Html File
How To Make More Than One Page In Html
How To Put An Image Beside Text In Html
How To Put Text Under An Image In Html
How To Write A Paragraph In Html