Skip to Content
OpportunitiesTechnicalIssue ReferenceStructured DataStructured data missing @type or @context

Structured data missing @type or @context

What it is

A JSON-LD block on the page is valid JSON, but an object at its top level or in its @graph list has no @type, or a top-level object has no @context. @type names the schema.org type the block describes, such as Organization, Product or Article, and @context says the names come from schema.org. Without them, the properties that follow, a name, a logo, a price, belong to nothing in particular.

Why it matters

Each of Google’s rich results is tied to a specific type, such as Product for price details or Recipe for recipe cards, and Google needs the required properties for that type  before it shows one. An untyped block cannot qualify for any of them, and the facts in it, such as your logo or opening hours, are unlikely to be used. The fix is usually one line.

How Asky checks it

Asky reads the page’s raw HTML and parses each <script type="application/ld+json"> block. Every top-level object needs @type and @context: a single object and each item of a top-level array, [ ... ]. An object that wraps an @graph list needs @context but no type of its own, while every item in the list needs @type, except one holding only an @id reference or adding properties to a typed item with the same @id. A top-level value that is not an object, such as null, misses both. Other nested objects are not checked. The finding says which of the two is missing. Blocks that do not parse are reported as invalid JSON.

Reported as an opportunity with low severity.

How to fix it

  1. Find the block: search the page source for application/ld+json.
  2. Add "@type" with the schema.org type that matches what the block describes, spelled as on schema.org. Case matters: LocalBusiness, not localbusiness.
  3. If the block is an array or has an @graph list, give every item in it its own @type; the object around an @graph needs none.
  4. If a plugin or template printed a half-filled block, fix the setting that feeds it rather than editing the page by hand.
  5. If @context is missing, add "@context": "https://schema.org" to each top-level object, next to its @type.

A fixed organization block, with the added line second:

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

Example

The homepage of https://example.com has a block with a context, a name and a logo, but nothing saying it describes an organization. Adding "@type": "Organization", as in the block above, clears the finding.


← Back to Structured Data

Last updated on