Structured data and the search engines that consume it

Classic on-page SEO advice centers on strong <title> elements, a long list of <meta> tags, and descriptive alt attributes on images, which also helps accessibility. Running a site through Lighthouse surfaces further best practices. Search engines, however, are moving beyond algorithmic scraping: Google, Amazon and Microsoft are investing heavily in machine learning, and those systems need clean data to work from.

That is where schemas come in. schema.org was established with funding from Google and Microsoft, along with Yahoo and Yandex, as a site and community to advance a shared format — commonly called structured data — so that search engines and others can surface content in more useful and engaging ways.

Structured data describes the content of digital documents such as websites and emails. Like <meta> tags, it forms an invisible layer of information that search engines read.

Three serializations

Structured data comes in three flavors: Microdata, RDFa and JSON-LD. Microdata and RDFa are injected directly into a document's HTML elements, peppering each relevant element with machine-readable pointers. The schema.org docs give this Microdata example for a product:

<div itemscope itemtype="http://schema.org/Product">
  <span itemprop="name">Kenmore White 17" Microwave</span>
  <img itemprop="image" src="kenmore-microwave-17in.jpg" alt='Kenmore 17" Microwave' />
  <div itemprop="aggregateRating"
    itemscope itemtype="http://schema.org/AggregateRating">
   Rated <span itemprop="ratingValue">3.5</span>/5
   based on <span itemprop="reviewCount">11</span> customer reviews
  </div>
  <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
    <!--price is 1000, a number, with locale-specific thousands separator
    and decimal mark, and the $ character is marked up with the
    machine-readable code "USD" -->
    <span itemprop="priceCurrency" content="USD">$</span><span
          itemprop="price" content="1000.00">1,000.00</span>
    <link itemprop="availability" href="http://schema.org/InStock" />In stock
  </div>
  Product description:
  <span itemprop="description">0.7 cubic feet countertop microwave.
  Has six preset cooking categories and convenience features like
  Add-A-Minute and Child Lock.</span>
  Customer reviews:
  <div itemprop="review" itemscope itemtype="http://schema.org/Review">
    <span itemprop="name">Not a happy camper</span> -
    by <span itemprop="author">Ellie</span>,
    <meta itemprop="datePublished" content="2011-04-01">April 1, 2011
    <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
      <meta itemprop="worstRating" content = "1">
      <span itemprop="ratingValue">1</span>/
      <span itemprop="bestRating">5</span>stars
    </div>
    <span itemprop="description">The lamp burned out and now I have to replace
    it. </span>
  </div>
  <div itemprop="review" itemscope itemtype="http://schema.org/Review">
    <span itemprop="name">Value purchase</span> -
    by <span itemprop="author">Lucas</span>,
    <meta itemprop="datePublished" content="2011-03-25">March 25, 2011
    <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
      <meta itemprop="worstRating" content = "1"/>
      <span itemprop="ratingValue">4</span>/
      <span itemprop="bestRating">5</span>stars
    </div>
    <span itemprop="description">Great microwave for the price. It is small and
    fits in my apartment.</span>
  </div>
  <!-- etc. -->
</div>

The result is somewhat bloated markup, but it does consolidate all of the data in one place.

JSON-LD normally sits in a <script> tag and describes the same properties in a single block. Again from the docs:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Product",
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "3.5",
    "reviewCount": "11"
  },
  "description": "0.7 cubic feet countertop microwave. Has six preset cooking categories and convenience features like Add-A-Minute and Child Lock.",
  "name": "Kenmore White 17\" Microwave",
  "image": "kenmore-microwave-17in.jpg",
  "offers": {
    "@type": "Offer",
    "availability": "http://schema.org/InStock",
    "price": "55.00",
    "priceCurrency": "USD"
  },
  "review": [
    {
      "@type": "Review",
      "author": "Ellie",
      "datePublished": "2011-04-01",
      "description": "The lamp burned out and now I have to replace it.",
      "name": "Not a happy camper",
      "reviewRating": {
        "@type": "Rating",
        "bestRating": "5",
        "ratingValue": "1",
        "worstRating": "1"
      }
    },
    {
      "@type": "Review",
      "author": "Lucas",
      "datePublished": "2011-03-25",
      "description": "Great microwave for the price. It is small and fits in my apartment.",
      "name": "Value purchase",
      "reviewRating": {
        "@type": "Rating",
        "bestRating": "5",
        "ratingValue": "4",
        "worstRating": "1"
      }
    }
  ]
}
</script>

Because it acts as an external instruction manual for your content — much as JavaScript handles scripts and CSS handles styles — JSON-LD stays self-contained. It can become essential for schema types where the page content differs from the structured data content, such as the speakable property, currently in beta.

Google now permits fetching structured data from an external source instead of requiring inline scripting — previously impossible — which eases JSON-LD adoption. This can be done by the developer or in Google Tag Manager.

Rich snippets and what they change

Beyond making crawlers' work easier, structured data is a route into rich snippets: highly visual modules that tend to sit at the top of results, sometimes called "Position 0." A search for "blueberry pie" in Google illustrates the effect:

Google search results showing three recipes displayed as cards at the top, a card of nutritional facts in the right sidebar, a first result showing user reviews, and finally, the search results.
Check out those three recipes up top — and that content in the right column — showing up before the list of results using details from structured data.

Even the first result there is a rich snippet. A site that does not appear in one risks being pushed below the fold; in the example, the second organic result barely makes the cut.

Structured data is not the only way into rich snippets — search engines can sometimes infer enough from your HTML to display some — but it improves the odds and puts the decision of how content is displayed in your hands rather than the search engine's.

Supported types

Structured data covers far more than recipes. Google maintains a full list of supported types, covering nearly any kind of content:

  • Article
  • Book (limited support)
  • Breadcrumb
  • Carousel
  • Course
  • COVID-19 announcements (beta)
  • Critic review (limited support)
  • Dataset
  • Employer aggregate rating
  • Estimated salary
  • Event
  • Fact check
  • FAQ
  • How-to
  • Image license metadata (beta)
  • Job posting
  • Local business
  • Logo
  • Movie
  • Product
  • Q&A
  • Recipe
  • Review snippet
  • Sitelinks searchbox
  • Software app
  • Speakable (beta)
  • Subscription and paywalled content
  • Video

Implementing a Logo type

Google's search catalogue is the easiest place to find the right type for a project; schema.org's full documentation is also available, though it is a deep rabbit hole. A simple starting point is the Logo data type, which needs only a website URL, an image source URL, and basic details identifying the content as a logo. Here is the JSON-LD:

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

The <script> tag tells search engines that JSON-LD follows. The object then carries five properties:

  • @context: present on all structured data objects regardless of type; it tells search engines the JSON-LD contains data defined by schema.org specifications.
  • @type: the reference type for the object, identifying the kind of content. Here it is "Organization," which has a range of sub-properties.
  • name: the organization's name.
  • url: the organization's web address.
  • logo: the file path to the logo image. For Google to consider it, the image must be at least 112⨉112px and in JPG, PNG, or GIF format — no SVG at the moment.

A single page can carry multiple structured data types, so content can be mixed and matched.

Validating the markup

Google, Bing and Yandex (login required) all offer testing tools; Google additionally has one for validating structured data in email. You supply the URL, the tool runs a test, and it reports which object it recognizes, which properties it sees, and any errors or warnings.

Showing Google's testing results where the JSON-LD is displayed on the left of the screen and the details of it on the right.
Google’s structured data testing tool fetches the markup and displays the information it recognizes.

The next step is confirming the data is accessible on the live site via Google Search Console. An account and site verification may be needed for a given engine's console, but checking is again a matter of supplying the URL and using the inspection tools to confirm the site is live and sending data when the search engine accesses it. Correctly implemented structured data displays in Google under the "Enhancements" section, marked with a checkmark.

Google Search Console screenshot showing Google can find the site and that it recognizes search enhancements below that. In this case, it is showing that the Logo structured data type was found and is supported.
Notice the “Logo” that is detected at the end — it works!

Expect a wait

As with any search engine optimization, there are no guarantees and no time scales for how or when structured data gets used. Rich snippets can take days, weeks, or even months to take hold for your content — it is a waiting game.