JSON-LD and Schema.org: a structured data guide for SEO

What structured data is, why Google recommends JSON-LD, which types to use on your site and how to test them, with ready-to-copy examples.

Teste de Performance team
4 min read

Key takeaways

  • Structured data is a set of invisible labels that tell machines what each piece of information on a page is: business, product, price, address.
  • Google recommends the JSON-LD format, a block of code kept separate from the page text.
  • It can unlock richer search results, but only works if it matches what is visible on the page.
In this guide
  1. Schema.org and JSON-LD: who is who
  2. What a JSON-LD block looks like
  3. The most useful types for most sites
  4. A note on FAQ and HowTo
  5. The rules Google enforces
  6. How to test
  7. How to add it without coding

When you read "$49.90" on a page, you instantly know it is a price. A search crawler is less sure: it could be a price, a code, a date. Structured data solves this. It is a kind of label, invisible to visitors, that tells machines: "this is a product, this is the price, this is the customer rating."

With these labels, Google understands the page better and can show rich results: star ratings, price and availability, breadcrumbs, the company logo. And it is not just Google: AI tools also benefit from well-organized information.

Schema.org and JSON-LD: who is who

  • Schema.org is the vocabulary: a public list of types (Organization, Product, Article, LocalBusiness...) and the properties of each. It was created jointly by Google, Microsoft, Yahoo and Yandex.
  • JSON-LD is the format you write these labels in: a block of code placed on the page, separate from the text.

Other formats exist (Microdata and RDFa), but Google recommends JSON-LD, because it does not mix with the page HTML and is easier to maintain.

What a JSON-LD block looks like

It goes inside a script tag of type application/ld+json, usually in the page head:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Sunrise Bakery",
  "url": "https://www.sunrisebakery.com",
  "logo": "https://www.sunrisebakery.com/logo.png"
}
</script>

Three things appear in every block:

  • @context: says the vocabulary used is schema.org's.
  • @type: the type of thing being described (here, an organization).
  • The properties: the actual data, such as name, site and logo.

The most useful types for most sites

Organization: who the business is

Helps Google associate a name, logo and website with your brand. Put it on the homepage.

WebSite: your site name in search

This is where Google gets the site name shown above the link in results. Without it, often only the domain appears.

{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "Sunrise Bakery",
  "alternateName": "Sunrise",
  "url": "https://www.sunrisebakery.com/"
}

LocalBusiness: for businesses with a physical address

Stores, clinics, restaurants and offices. States address, phone number and opening hours.

{
  "@context": "https://schema.org",
  "@type": "Bakery",
  "name": "Sunrise Bakery",
  "telephone": "+1 512-555-0134",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "120 Main Street",
    "addressLocality": "Austin",
    "addressRegion": "TX",
    "postalCode": "78701",
    "addressCountry": "US"
  },
  "openingHours": "Mo-Sa 06:00-20:00"
}

Bakery is a subtype of LocalBusiness. Use the most specific type available for your business, such as Dentist, Restaurant or Store.

Product: for online stores

Name, image, price, availability and reviews. This is what can bring price and stars into search results.

{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Sourdough loaf, 1 kg",
  "image": "https://www.sunrisebakery.com/img/sourdough.jpg",
  "offers": {
    "@type": "Offer",
    "price": "8.90",
    "priceCurrency": "USD",
    "availability": "https://schema.org/InStock"
  }
}

Note that the price uses a period as the decimal separator and has no currency symbol: the currency goes in priceCurrency, as an ISO code (USD, EUR, GBP...).

Article or BlogPosting: for posts and news

Headline, publication date, update date and author. Helps Google show the right date and understand who wrote it.

BreadcrumbList: the navigation trail

Shows the page path (Home › Blog › Post) instead of the long URL in search results.

A note on FAQ and HowTo

For a long time, marking up frequently asked questions (FAQPage) and step-by-step guides (HowTo) produced large blocks in Google. That changed in 2023: Google now shows FAQ rich results only for well-known government and health sites, and stopped showing HowTo. The markup is still valid and does no harm, but do not expect it to stand out in search.

The rules Google enforces

  1. Mark up only what is visible. If your JSON-LD says the product costs $8.90, that price must appear on the page. Hidden data or data that differs from the content can lead to a manual action from Google.
  2. Be truthful. Fake reviews, or reviews a business marks up about itself, do not count.
  3. Use full URLs (with https://) for links and images.
  4. Keep it up to date. Price changed? Hours changed? Your JSON-LD needs to change too.
  5. There is no guarantee. Even with everything right, Google decides whether and when to show a rich result.

How to test

  • Rich Results Test, from Google: shows which rich results the page can generate and points out errors.
  • Schema Markup Validator (validator.schema.org): checks whether your code follows the schema.org vocabulary, even for types Google does not use.
  • Google Search Console: after publishing, the "Enhancements" section shows the structured data found and the problems on each page.

How to add it without coding

  • WordPress: SEO plugins like Yoast SEO and Rank Math already generate Organization, WebSite, Article and BreadcrumbList. For stores, WooCommerce generates product data.
  • E-commerce platforms (Shopify, BigCommerce, Wix) usually generate Product markup automatically. It is worth checking with Google's test.
  • Custom-built sites: ask your developer to add the blocks to page templates, fed by the same data shown on screen.

Where to start: WebSite and Organization on the homepage, BreadcrumbList on inner pages and your business's main type (LocalBusiness, Product or Article). That covers the essentials for most sites.

Keep reading