# Structured Data

Structured data in a page's head HTML allows it to appear as rich content in search results.

Rich result in Google preview

This data must be identical for Desktop, Standard Web Mobile, and Google AMP Pages.

There are 3 valid data types that you can choose from if you have AMP Pages:

Compass also validates the rest of the information contained in structured data.

# Headline

Structured data must include the article headline.

"headline": "Boy discovers comet!"

Note that the headline can't be more than 110 characters. This example one is 19 characters long.

TIP

Do not confuse the article headline with the webpage title!

# Author

Structured data must always include author information, which can be a person or an organization.

For a person, their name is the only required field:

"author": {
  "@type": "Person",
  "name": "John Doe"
}

An organization author works on the same model:

"author": {
  "@type": "Organization",
  "name": "Marfeel"
}

In both cases, the author's name can't be empty, and it must be the same as who visibly signed the piece.

This means you can't use a generic "Our redaction" as the author name in structured data and later give more details in the articles' body.

# Date

Structured data must always include published and modified dates, in the ISO 8601 format (opens new window):

"datePublished": "2021-02-05T08:00:00+08:00",
"dateModified": "2021-02-05T09:20:00+08:00"

The modified date must be identical to the user-visible publication time of the article.

Finally, the modified date must be more recent than the published date and use your timezone, accounting for daylight saving time.

# Publisher

Structured data must include the publisher information. The publisher must be an organization, and you have to provide at least a name and a logo:

"publisher": {
  "@type": "Organization",
  "name": "Springfield Shopper",
  "logo": {
    "@type": "ImageObject",
    "url": "https://static.wikia.nocookie.net/simpsons/images/b/bc/Springfield_Shopper_yellow.png"
  }
}

Your organization name in the structured data must coincide with Google's publisher center (opens new window).

Finally, Compass validates a few things about the logo:

  • The URL has to return an HTTP code 200 or 304 when requested.
  • The image must fit in a 60x600px rectangle, with one of those measurements being exact. This means that a 60x300px or 30x600px logo works, but not a 75x600px logo.
  • The image type must be one of BMP, GIF, JPEG, or PNG.

# Article Image

Structured data must always point to an image that illustrates the article.

"image": [
  {
    "@type":"ImageObject",
    "url":"https://images.unsplash.com/photo-1534361960057-19889db9621e",
    "width":"5184",
    "height":"3456"
  }
]

This image object must always include at least a URL, a width, and a height.

The image URL must return an HTTP status code 200 when requested and must be one of BMP, GIF, JPEG, or PNG.

The minimum accepted image width is 1200 pixels, and the width and height fields must indicate the real image dimensions.

The structured data must include a link to the canonical URL of the page using the mainEntityOfPage field:

"mainEntityOfPage": {
  "@type": "WebPage",
  "@id": "https://www.news.com/missing-phonebox.html"
}

TIP

The canonical URL of a page is its Standard Web version.

# Section

Finally, the structured data must include the section the article belongs to, and that information must coincide with the user-visible section information:

"articleSection": "Lifestyle"

# Complete Structured Data

All those requirements put together lead to a block of structured data that can look like the following:

{
  "@context": "https://schema.org/",
  "@graph": [
    {
      "@context": "https://schema.org/",
      "@type": "NewsArticle",
      "author": {
        "@type": "Person",
        "name": "Sarah Jane Smith"
      },
      "datePublished": "2021-02-02T14:02:03Z",
      "dateModified": "2021-02-03T00:32:30Z",
      "headline": "Missing Phonebox becomes viral",
      "articleSection": "Local",
      "image": {
        "@type": "ImageObject",
        "url": "https://upload.wikimedia.org/wikipedia/commons/d/d9/Tardis_BBC_Television_Center.jpg",
        "height": "2848",
        "width": "4288"
      },
      "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://www.news.com/missing-phonebox.html"
      },
      "publisher": {
        "@type": "Organization",
        "name": "The News",
        "logo": {
          "@type": "ImageObject",
          "url": "https://live.mrf.io/statics1340/www.news.com/index/logo.png"
        }
      }
    }
  ]
}

Your structured data can contain more information as you need it, as long as they don't affect the properties described in this article.

Check available properties on the Schema organisation website: