All HTML guides
Publishing7 min read

How to Add Structured Data to an HTML Page

Use JSON-LD to describe articles, organizations, products, and breadcrumbs without making claims the visible page cannot support.

The short version

Structured data should mirror the visible page, not become a hidden marketing layer.

01

Choose a type that matches the page

Structured data gives machines explicit information about the content. Start with one schema type that describes the page accurately. An article page can use Article or BlogPosting; a company homepage can describe an Organization.

Eligibility for a rich search result is not guaranteed. The practical goal is clean, consistent machine-readable context.

html
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "How to Add Structured Data to an HTML Page",
  "datePublished": "2026-07-29",
  "author": { "@type": "Organization", "name": "HTML Docs" }
}
</script>
02

Keep it aligned with visible content

Do not add reviews, prices, FAQs, or authors that a reader cannot find on the page. Update dates only when the content meaningfully changes. Use the same canonical URL and organization name across metadata systems.

03

Validate before publishing

  • Parse the JSON to catch syntax errors.
  • Run the relevant rich-results or schema validator.
  • Check generated output, not only the source template.
  • Monitor search-console warnings after release.

Official references

Keep going

Related HTML guides