Sub topic 9
Structured data that mirrors the visible page
Assume you know basic HTML, including headings, paragraphs, lists, and script elements. You should also understand that search and AI answer systems retrieve passages from a page instead of treating the whole page as one indivisible answer.
Structured data is machine-readable information embedded in a web page. JSON-LD is a format for writing that information as JSON inside a <script type="application/ld+json"> element. It can describe a question and its answer, an article, a product, or another supported content type.
Structured data can clarify the role of visible content. It cannot replace clear writing, grant a citation, or force an AI system to use your page. The structured data should describe content that users can already see.
Why visible text and JSON-LD must agree
Suppose a page visibly answers this question:
“What is a canonical URL?”
The page says that a canonical URL is the preferred address when the same content is available at several URLs. Its JSON-LD should describe that same question and answer. It should not add claims that are absent from the page.
A mismatch creates several problems:
- Search engines may ignore the structured data.
- Users cannot verify the information from the page.
- An answer system may treat the markup as less trustworthy.
- Editors may update one version and forget the other.
The visible answer should remain useful if the script is removed. The script should make the visible structure easier for machines to interpret.
A matching FAQ example
The following page uses a question-led heading, a direct answer, and matching FAQPage JSON-LD.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Canonical URLs</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What is a canonical URL?",
"acceptedAnswer": {
"@type": "Answer",
"text": "A canonical URL is the preferred address of a page when the same content is available at several URLs."
}
}
]
}
</script>
</head>
<body>
<main>
<h1>Canonical URLs</h1>
<section>
<h2>What is a canonical URL?</h2>
<p>A canonical URL is the preferred address of a page when the same content is available at several URLs.</p>
<p>Use a canonical link when duplicate or near-duplicate URLs could divide indexing signals.</p>
</section>
</main>
</body>
</html>The JSON-LD repeats the first sentence exactly. The second visible sentence adds useful context but does not contradict the structured answer.
Use FAQPage only when the page contains a genuine set of questions and answers. Do not add hidden questions simply to target more queries.
| Page content | Suitable structured data | Main condition |
|---|---|---|
| Visible questions with answers | `FAQPage` | The questions and answers are present on the page |
| One article or tutorial | `Article` or a related type | The metadata describes that article |
| A software product | `SoftwareApplication` | The product details are visible and accurate |
Keep each answer self-contained
An AI system may retrieve the answer paragraph without the surrounding page. Write the answer so that its subject and meaning survive extraction.
Weak passage:
“Use it when duplicates are a problem.”
Self-contained passage:
“Use a canonical URL when the same content is available at several URLs and you want search engines to treat one address as preferred.”
The second version names the subject, condition, and purpose. If the wording changes, update both the visible passage and its JSON-LD.
A practical review sequence
- Find the visible question and its direct answer.
- Check that the answer is specific enough to stand alone.
- Select a schema type that fits the page.
- Copy the visible meaning into the JSON-LD.
- Remove fields that are missing, speculative, or hidden.
- Validate the syntax and review the rendered page.
- Repeat the check whenever the content changes.
Exercise
A page visibly says, “A canonical URL is the preferred address when duplicate URLs show the same content.” Its JSON-LD says, “A canonical URL guarantees that a page will rank first.” What should you do?
Show answer
Replace the JSON-LD answer with the visible, supportable definition. The guarantee is a different and unsupported claim.