All rules
optional
Rule: structured-data-validWeight: 2/100

Rule: structured-data-valid

Having JSON-LD on your page is necessary but not sufficient. If it lacks the required @context and @type fields, search engines silently ignore it. You think you have structured data; Google thinks you don't. This rule catches the most common structural errors in JSON-LD.

Run the check
$ npx indxel check
Look for structured-data-valid in the output

What it checks

For every <script type="application/ld+json"> block found on the page, Indxel parses the JSON and checks: (1) the JSON is syntactically valid, (2) an @context field exists (should be 'https://schema.org'), and (3) an @type field exists. If any block fails these checks, the rule triggers a warning.

Thresholds

PASS

All JSON-LD blocks have valid JSON with @context and @type

WARN

One or more JSON-LD blocks are missing @context or @type

Edge cases

1

If structured-data-present fails (no JSON-LD at all), this rule is skipped.

2

Nested @type in @graph arrays: Indxel checks the top-level @type and also inspects @graph items for their own @type. A top-level @graph without a @type is valid if each graph item has @type.

3

@context can be 'https://schema.org' or 'http://schema.org'. Both are accepted. Google prefers https but accepts both.

4

JSON-LD with a syntax error (missing comma, extra bracket) fails parsing entirely. Indxel treats this as invalid.

Configuration

indxel.config.ts
// indxel.config.ts
import { defineSEO } from "indxel";

export default defineSEO({
  rules: {
    "structured-data-valid": true, // enabled by default
  },
});

// Ensure every JSON-LD block has @context and @type:
const schema = {
  "@context": "https://schema.org", // required
  "@type": "FAQPage",              // required
  mainEntity: [/* ... */],
};

Frequently asked questions

What if my JSON-LD uses @graph?

Indxel handles @graph arrays. If the top-level object has @context and uses @graph, each item in the graph is checked for @type. This is a common pattern for combining multiple schema types in one block.

Can I use http:// for @context?

Google accepts both 'http://schema.org' and 'https://schema.org' for @context. Indxel accepts both. However, Google's documentation recommends https, so prefer 'https://schema.org'.

Related rules

structured-data-present

optional — 4/100

structured-data-complete

optional — 4/100

structured-data-duplicates

optional — 2/100

Validate your SEO now

$npx indxel check
Get startedBrowse all rules
Indxel

SEO validation that runs in your terminal and blocks bad deploys.

GitHubnpm

Product

  • Documentation
  • Pricing
  • Plus Plan
  • CI/CD Guard
  • Indexation
  • Free Tools
  • Blog

Comparisons

  • vs Semrush
  • vs Ahrefs
  • vs Moz
  • vs Screaming Frog
  • All comparisons

Integrations

  • Vercel
  • GitHub Actions
  • Netlify
  • Docker
  • All integrations

Resources

  • Frameworks & use cases
  • Next.js
  • For freelancers
  • For agencies
  • SEO Glossary

Built with care. MIT Licensed.

PrivacyTermsLegalContact