DEV Community

rokya elbarbary
rokya elbarbary

Posted on Fully Autonomous

Structured Data Templates (JSON-LD) You Can Copy Into Your Templates

Structured data tells search engines explicitly what a page is about: which organisation publishes it, who wrote an article, where a page sits in the site hierarchy. It does not guarantee a rich result, and Google has narrowed several rich result types over time, so treat markup as a way to describe your content accurately rather than as a ranking trick.

Google recommends JSON-LD, placed in a <script type="application/ld+json"> block. The templates below use only properties documented by Google or schema.org. Replace every value in angle brackets, and delete any property you cannot fill truthfully.

Organization (site-wide, usually on the homepage)

{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "<Legal or trading name>",
  "url": "https://<your-domain>/",
  "logo": "https://<your-domain>/<path-to-logo>.png",
  "sameAs": [
    "https://www.linkedin.com/company/<handle>",
    "https://www.instagram.com/<handle>/"
  ]
}
Enter fullscreen mode Exit fullscreen mode

Notes:

  • logo should be a crawlable image URL. Google documents its logo requirements in the Organization structured data guidelines.
  • Only list profiles in sameAs that you actually control.
  • Only add address or telephone if they are real and match what is shown on the page. Placeholder contact details in markup are worse than none.

Article (blog posts and guides)

{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "<Title as shown on the page>",
  "datePublished": "<YYYY-MM-DD>",
  "dateModified": "<YYYY-MM-DD>",
  "author": [{
    "@type": "Person",
    "name": "<Author name>",
    "url": "https://<your-domain>/<author-page>"
  }],
  "image": ["https://<your-domain>/<hero-image>.jpg"]
}
Enter fullscreen mode Exit fullscreen mode

Notes:

  • dateModified should change only when the content meaningfully changes.
  • If the author is the organisation rather than a person, use "@type": "Organization" for the author.

BreadcrumbList

{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    { "@type": "ListItem", "position": 1, "name": "Home", "item": "https://<your-domain>/" },
    { "@type": "ListItem", "position": 2, "name": "Services", "item": "https://<your-domain>/services" },
    { "@type": "ListItem", "position": 3, "name": "<Current page>" }
  ]
}
Enter fullscreen mode Exit fullscreen mode

The last item may omit item. The trail should match the breadcrumb that users see.

Service (describing what you offer on a service page)

Google does not currently show a dedicated rich result for Service, but the type is valid schema.org vocabulary and helps describe a page unambiguously.

{
  "@context": "https://schema.org",
  "@type": "Service",
  "name": "<Service name>",
  "serviceType": "<e.g. Search engine optimisation>",
  "provider": { "@type": "Organization", "name": "<Your organisation>", "url": "https://<your-domain>/" },
  "areaServed": ["<Country or region>"],
  "url": "https://<your-domain>/<service-page>"
}
Enter fullscreen mode Exit fullscreen mode

Types to handle with care

  • FAQPage: since 2023 Google shows FAQ rich results only for a limited set of well-known, authoritative government and health sites. Marking up a genuine FAQ is still valid, but do not expect a visual result.
  • HowTo: HowTo rich results have been deprecated in Google Search.
  • Review / AggregateRating: self-serving reviews of your own business are not eligible for review snippets. Never mark up testimonials you cannot substantiate.

Validation workflow

  1. Validate syntax with the Schema Markup Validator.
  2. Check eligibility with Google's Rich Results Test.
  3. After deployment, watch the enhancement reports in Search Console for errors that appear at scale.
  4. Keep markup in the template, generated from the same data as the visible page, so the two cannot drift apart.

Further reading

Top comments (0)