JSON-LD that cannot lie: schema markup generated from the same data as the page
Most writing about schema markup is a list of types to add. The problems developers actually run into are different, and none of them is a missing type. Markup drifts out of step with the page it describes. Markup gets i
Most writing about schema markup is a list of types to add. The problems developers actually run into are different, and none of them is a missing type. Markup drifts out of step with the page it describes. Markup gets injected by a script that half the crawlers never run. And markup gets added for rich results that Google stopped showing years ago, because the checklist was written before it did.
This is the developer-side version of a guide we wrote for site owners. It covers what still earns anything in Google in 2026, and then the three engineering decisions that matter more than which types you pick: where the markup comes from, where it is rendered, and how you find out when it disagrees with the page.
What is still worth marking up
The list of rich results has been shrinking for three years. In August 2023 Google limited FAQ rich results to well-known government and health sites, and in September 2023 it stopped showing HowTo results entirely. In January 2025 breadcrumbs disappeared from mobile results, which now show only the domain; the markup is still supported on desktop. In June 2025 Google began phasing out seven types it called rarely used, among them Course info, Claim review and Estimated salary, and practice problems followed in January 2026. Then on 7 May 2026 FAQ rich results stopped appearing for everyone, and in June the documentation went too. For years FAQ schema was the easiest way to take up more room on a results page. In Google it now does nothing visible.
What survives is markup that describes something a searcher can act on: a product to buy, an event to attend, a job to apply for, a video to watch. Google's Search Gallery lists 25 features as of its June 2026 update. Product with an Offer still earns price, availability and shipping details. Event, JobPosting and VideoObject still earn their own results. Organization, LocalBusiness and Article are still read, even where there is no visible enhancement, because they tell Google which company owns a page and which page is an article about what.
Two practical consequences for whoever owns the templates. Markup Google no longer uses does no harm, by Google's own statement, so there is no need to rip out old FAQPage blocks. And a rich result is never guaranteed: Google's guidelines say structured data makes a page eligible, and Google decides page by page and query by query whether to show anything.
Decision one: generate it, never write it
The single most common way schema goes wrong is not a wrong type. It is markup that was correct on the day someone pasted it in, and has been wrong since the first time someone changed the visible page. The price on the page went up; the price in the JSON-LD did not. A sale ended; priceValidUntil still says last month, and the product's rich result disappears without a single error anywhere.
The fix is structural rather than procedural: the markup is built from the same object that renders the page, in the same template, so the two cannot disagree. In a Next.js App Router page it looks like this:
// app/products/[slug]/page.tsx
import { getProduct } from '@/lib/products'
import { Price } from '@/components/Price'
export default async function ProductPage({ params }: { params: Promise<{ slug: string }> }) {
const { slug } = await params
const product = await getProduct(slug)
const jsonLd = {
'@context': 'https://schema.org',
'@type': 'Product',
name: product.name,
image: product.images,
description: product.summary,
sku: product.sku,
offers: {
'@type': 'Offer',
url: `https://example.com/products/${slug}`,
price: product.price.toFixed(2),
priceCurrency: product.currency,
availability: product.inStock ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock',
// Only while a sale runs, and straight from the same field the sale banner reads.
...(product.saleEndsAt ? { priceValidUntil: product.saleEndsAt.slice(0, 10) } : {}),
},
}
return (
<>
<script
type="application/ld+json"
// Escape "<" so a product name can never close the script tag early.
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd).replace(/</g, '\\u003c') }}
/>
<h1>{product.name}</h1>
<Price value={product.price} currency={product.currency} />
</>
)
}
There is nothing clever in it, which is the point. The product object that feeds the <Price> component also feeds offers.price, so a price change in the CMS changes both. The replace on the serialised JSON is the escaping Next.js recommends in its own JSON-LD guide: without it, a string containing </script> in a product name or a review would end the tag early.
Our own site works this way. Every guide carries Article and BreadcrumbList markup built from the guide's data, every package on our price list is a Service and Product with an Offer whose priceValidUntil is computed rather than typed, and the FAQ markup on each guide is generated from the same question-and-answer array the reader sees at the bottom of the page.
The bug that taught us to strip formatting
Generating from the same data has one trap, and we walked into it. Our FAQ answers are authored with a little inline Markdown, links as [text](/path) and bold as **text**, which a renderer turns into HTML for the page. The FAQPage builder took the same strings and put them straight into acceptedAnswer.text. The page looked perfect. The structured data carried literal asterisks and bracket syntax in every answer that used emphasis, until we noticed in September 2026.
Schema text properties are plain text, so anything authored for a renderer has to be reduced to plain text before it goes into the markup. A minimal version of what our builders now call:
// "[text](/path)" -> "text", "**bold**" -> "bold", "*italic*" -> "italic"
export const stripInlineMarkup = (s: string) =>
s
.replace(/\[([^\]]+)\]\([^)]+\)/g, '$1')
.replace(/\*\*([^*]+)\*\*/g, '$1')
.replace(/\*([^*]+)\*/g, '$1')
const faqJsonLd = {
'@context': 'https://schema.org',
'@type': 'FAQPage',
mainEntity: faqs.map(f => ({
'@type': 'Question',
name: f.q,
acceptedAnswer: { '@type': 'Answer', text: stripInlineMarkup(f.a) },
})),
}
The general rule: the markup should carry the same facts as the page, in the plain form the vocabulary expects, and any transformation between the two belongs in one shared function, not in each builder. We had ten FAQPage builders when we found it, and the fix was one function called from all ten.
We kept the FAQPage markup after Google stopped showing FAQ results in May. It costs nothing, Google says unused markup causes no problems, and other systems that read pages may still use it.
Decision two: render it on the server
Google renders JavaScript, so JSON-LD added in the browser by a tag manager or a client component usually reaches Google eventually. Most other readers never see it. Vercel's analysis of AI crawler traffic, published in December 2024, found that none of the major AI crawlers, including GPTBot, ClaudeBot and PerplexityBot, execute JavaScript; they fetch script files and do nothing with them.
That makes the test for whether your markup exists very simple: request the page the way a crawler does and look for it.
curl -s https://example.com/products/blue-mug | grep -c 'application/ld+json'
If that prints 0 while the browser's DevTools show the script tag, the markup is being added client-side, and only the systems that run JavaScript will ever see it. In a server-rendered or statically generated page, as in the example above, the tag is in the HTML the server sends, and every reader gets it.
Decision three: test that markup and page agree
Google's Rich Results Test answers "which Google features is this page eligible for", and the Schema Markup Validator, run by schema.org, checks the markup against the full vocabulary, including types Google ignores. Both check one URL at a time and neither compares the markup with what is visible on the page, which is the failure that actually happens.
That comparison is cheap to automate against a built site. Pull the JSON-LD out of the HTML, then assert that the facts it states appear in the visible text:
const html = await (await fetch(url)).text()
const blocks = [...html.matchAll(/<script type="application\/ld\+json">([\s\S]*?)<\/script>/g)]
.map(m => JSON.parse(m[1]))
const product = blocks.find(b => b['@type'] === 'Product')
const visible = html.replace(/<script[\s\S]*?<\/script>/g, '').replace(/<[^>]+>/g, ' ')
if (product && !visible.includes(product.offers.price.replace('.', ','))
&& !visible.includes(product.offers.price)) {
throw new Error(`${url}: markup price ${product.offers.price} is not on the page`)
}
It is crude, it needs adjusting for how your site formats prices, and it catches the drift that no validator will. After launch, Search Console's enhancement reports show markup errors across the whole site, and URL Inspection confirms whether Google saw the markup on a given page.
The rules that cost you more than a missing rich result
Google treats markup that describes content not visible on the page as spam, and its guidelines say a structured data issue can lead to a manual action, which removes your rich results until it is fixed. Hidden FAQ answers, ratings that appear nowhere on the page and prices that differ from the visible ones all qualify. Generating markup from the page's data makes this mistake hard to make by accident, which is another argument for doing it.
Review stars are the other trap. If the business being reviewed controls the reviews about itself, its pages using LocalBusiness or Organization markup are not eligible for star ratings at all. Testimonials on your own site are fine to show; marking them up for stars will not work. And two plugins each emitting their own Organization block, with different names or logos, give every reader two conflicting answers about who owns the site. Check what your platform already outputs before adding anything.
What AI search does with it
Google's documentation for AI Overviews and AI Mode says there is no special structured data needed to appear in them, and asks only that structured data match the visible text. Microsoft has been more direct: Bing's Fabrice Canel said at SMX Munich in March 2025 that schema markup helps Microsoft's language models understand content. Whether the other model providers use it has not been confirmed by them.
Our reading is that schema will not make an AI system cite a page, but it removes ambiguity about the facts it might cite: the price, the opening hours, the author, stated as labelled data rather than inferred from layout. That only helps if the markup is in the HTML the crawler receives and says the same thing as the page, which brings it back to the two decisions above.
Read the full version
This is the developer-side cut. The full guide has the table of every major schema type and its status in Google as of October 2026, which types a shop, a local business and a service company need, Google's own click-through case studies, and the full markup on our home page and price list.
Schema markup explained: what still earns rich results in 2026
This copy is a snapshot from the day it was posted, and it will not be updated here. The original on our site is the version we keep current: when a study publishes new figures, a price changes or a tool is renamed, that is where the correction lands. If you want the up-to-date version, follow the link above.
Sources
The FAQ removal on 7 May 2026 and the documentation removal in June are in Google's Search Central documentation updates, the 2023 FAQ and HowTo changes in Changes to HowTo and FAQ rich results, the mobile breadcrumb change in Simplifying the visible URL element, and the June 2025 phase-out in Simplifying the search results page. The 25 supported features are listed in the Search Gallery. The no-guarantee rule, the ban on marking up invisible content and the manual actions are in the General structured data guidelines, and the self-serving review rule in the Review snippet documentation. Google's position on AI features is in AI features and your website; Microsoft's is reported by Search Engine Land. The crawler finding is from Vercel's The rise of the AI crawler, and the script escaping from the Next.js JSON-LD guide. The product page and the agreement test are illustrative examples; the FAQ formatting bug is our own.
Which has bitten you more often: markup the crawlers never saw, or markup that said something different from the page?
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.