Schema and trust
Structured data (JSON-LD): describe your page to machines
JSON-LD structured data tells search engines and AI what your page is: an organization, product, article and more. Valid JSON-LD with a known type earns full points.
- Category
- Schema and trust
- Points available
- 5 pts
- Effort
- Medium effort
Why it matters
Structured data makes you eligible for rich results: product stars and prices, breadcrumbs, articles, events and more. These stand out and get more clicks.
It also gives search engines and AI assistants clear facts about your business (name, logo, social profiles), which helps them recognise you as an entity.
How we measure it
We parse every <script type="application/ld+json"> block. A block is valid if it is valid JSON. We collect every @type, including nested ones and @graph items.
Full points need at least one valid block with a recognised schema.org type (such as Organization, LocalBusiness, WebSite, WebPage, Product, Offer, Article, BlogPosting, BreadcrumbList, FAQPage, Event, Recipe or SoftwareApplication). Any invalid block costs one point.
| Result | Points |
|---|---|
| Valid, with a recognised type | 5 |
| Recognised type, but another block is invalid | 4 |
| Valid, but no recognised type | 3 |
| Only invalid blocks | 1 |
| No JSON-LD | 0 |
How to fix it
- Add Organization (or LocalBusiness) and WebSite on the home page.
- Add the type that matches each page: Product with Offer on product pages, Article on posts, BreadcrumbList where you show breadcrumbs.
- Generate JSON with a JSON encoder (
wp_json_encode,JSON.stringify) instead of string templates, to avoid syntax errors. - Validate with Google's Rich Results Test and validator.schema.org.
Copy-paste fixes
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://www.example.com/#org",
"name": "Northpeak",
"url": "https://www.example.com/",
"logo": "https://www.example.com/logo.png",
"sameAs": ["https://www.linkedin.com/company/northpeak", "https://www.instagram.com/northpeak"]
},
{
"@type": "WebSite",
"name": "Northpeak",
"url": "https://www.example.com/",
"publisher": { "@id": "https://www.example.com/#org" }
}
]
}
</script>// Only if no SEO plugin (Yoast, Rank Math) already outputs schema.
add_action( 'wp_head', function () {
if ( ! is_front_page() ) {
return;
}
$data = array(
'@context' => 'https://schema.org',
'@type' => 'Organization',
'name' => get_bloginfo( 'name' ),
'url' => home_url( '/' ),
'logo' => get_site_icon_url( 512 ),
);
echo '<script type="application/ld+json">' . wp_json_encode( $data ) . '</script>' . "\n";
} );<script type="application/ld+json">
{{ product | structured_data }}
</script>const jsonLd = {
"@context": "https://schema.org",
"@type": "Organization",
name: "Northpeak",
url: "https://www.example.com/",
logo: "https://www.example.com/logo.png",
};
export default function Home() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd).replace(/</g, "\\u003c") }}
/>
{/* page content */}
</>
);
}Common mistakes
- Trailing commas or unescaped quotes that make the block invalid JSON.
- Marking up content that is not visible on the page (fake reviews or FAQs).
- Two plugins outputting conflicting Organization data.
Test your site now
Put your site against a competitor and see how many of these points you earn, and which fixes pay off first.