Blog
Schema Markup (JSON-LD): Add It, Validate It, Fix the Errors
Add JSON-LD schema markup, run schema markup validation, and fix the errors Google's Rich Results Test and the Schema.org Markup Validator report.
Muhammad Zubair Akhtar
Schema markup is structured data: a machine-readable description of what the page already shows. JSON-LD schema markup puts that description in a script tag. Google recommends JSON-LD when the site can maintain it. This page is how to add the script, run schema markup validation, and fix the errors those two checks report.
I am Muhammad Zubair Akhtar, a senior software engineer in Lahore, Pakistan. I work on Laravel, WordPress, and Next.js. Crawl, index, and the template checks around this sit in the technical SEO checklist. This page is only the markup. If you want the script in a live template compared with the HTML a crawler fetches, that work is under technical SEO services.
On 10 November 2026 I read Google's intro to structured data, the general guidelines, the Article and breadcrumb docs, the JavaScript generation guide, the testing tools page, the supported features gallery, the 8 August 2023 post on HowTo and FAQ rich results, and the Search Central changelog entries dated 8 May 2026 and 15 June 2026. I have not run the Rich Results Test or the Schema.org Markup Validator for this article, and I have not executed the snippets below.

Figure 1. Add the script, validate with both tools, fix the error each one names, then inspect the live URL. A pass in one tool is not a pass in the other.
What schema markup is for
Google's intro describes structured data as a standardized format that classifies the page. An article can name the headline, the author, and the dates. Google uses that to understand the page, and sometimes to show a rich result. The general guidelines say Google does not guarantee that appearance, even when the Rich Results Test says the page is eligible. Search can still show an ordinary text result.
Markup does not repair a URL that failed crawl or index. I add it after the status code, robots.txt, and the canonical. That order is the technical SEO checklist. A URL disallowed in robots.txt never shows Google the script. The robots.txt guide is that split.
Google supports JSON-LD, Microdata, and RDFa. The intro says all three are fine when the markup is valid and follows the feature's documentation, and it recommends JSON-LD because the data is not woven through the visible text. Markup from data-vocabulary.org is no longer eligible for Google rich results.
The script has to describe the page it is on, and only what a reader can see. The quality guidelines say not to mark up hidden content, fake reviews, or a type that is not the page. A structured-data manual action removes rich-result eligibility. Those guidelines say that action does not change how the page ranks in web search. I am not claiming a ranking change from adding a script, and I am not publishing a measurement.
Add JSON-LD schema markup in the HTML
A JSON-LD block is a script element with type="application/ld+json". Google's format notes place it in the head or the body. Put it in the HTML the server sends when you can.
Google's JavaScript guide says Google can read JSON-LD that a script injects into the DOM, including through Google Tag Manager. For a JavaScript page, that guide says to test with the URL field in the Rich Results Test, because the code field has limits such as CORS. The same guide warns that dynamically generated Product markup can make Shopping crawls less frequent and less reliable when price and availability change quickly. On a product URL I print the JSON-LD in the first HTML. Which Product fields Google requires depends on product snippets versus merchant listings. That split is in technical SEO for ecommerce.
The sentence in the script and the sentence on the page have to come from the same record. A price in JSON-LD from one query and a price label from another will drift after the next edit. On Laravel I would print the script from the model the Blade view already uses. On WordPress I would print it from the post the template already loaded. I have not shipped either of those for this article.
One page can carry more than one type. The general guidelines show a main type plus a separate BreadcrumbList, nested or as separate objects. Separate script tags are fine. Use @id when two nodes are the same thing, so Google can tell a video is about the recipe on that page. The main type should be what the page is about. This site prints the site-wide graph in the layout and the page graph in a second script.
Article has no required properties
Google's Article docs say there are no required properties. Add the recommended ones that apply to the page. The type has to be Article, NewsArticle, or BlogPosting. Recommended fields include headline, image, datePublished, dateModified, and author.
Dates should be ISO 8601. Google recommends a timezone. If you omit it, Google uses the timezone Googlebot uses. author.name is only the person's name, or only the organization's name. Do not put a job title, an honorific, or "posted by" in that string. jobTitle is its own property when you need it. Give the author a url or sameAs that identifies them. Use Person for a person and Organization for an organization. Several authors are an array of objects, not one name string with a comma in it. The publisher goes on publisher, not inside author.name.
Image URLs have to be absolute, crawlable, and a picture of the article rather than a logo. Google recommends more than one high-resolution image, at least 50,000 pixels when width is multiplied by height, at 16:9, 4:3, and 1:1.
This example follows that page. The values are placeholders.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": "Schema markup in JSON-LD",
"image": [
"https://example.com/photos/1x1/photo.jpg",
"https://example.com/photos/4x3/photo.jpg",
"https://example.com/photos/16x9/photo.jpg"
],
"datePublished": "2026-11-10T00:00:00+05:00",
"dateModified": "2026-11-10T00:00:00+05:00",
"author": [{
"@type": "Person",
"name": "Muhammad Zubair Akhtar",
"url": "https://example.com/about"
}]
}
</script>
This site's article template already emits BlogPosting from the post title, description, date, and image, and points author at the Person @id in the layout graph. The body of a post should not add a second Article node. The technical SEO checklist says the same thing. I am describing the template source. I have not submitted this URL to the Rich Results Test for this article.
BreadcrumbList does have required properties
Google's breadcrumb docs need a BreadcrumbList with itemListElement, and at least two ListItem entries. Each item needs position, name, and item. Position 1 is the start of the trail. item is the page URL, or a thing identified with @id. The last item may omit item. Google then uses the URL of the page that contains the list. Google recommends a trail a person would walk, not a copy of every folder in the path. The docs list the feature as available on desktop, in the languages and regions where Google Search is available.
The last item below omits item on purpose. The host is a placeholder.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Blog",
"item": "https://example.com/blog"
}, {
"@type": "ListItem",
"position": 2,
"name": "Schema markup"
}]
}
</script>
Do not add FAQ or HowTo for a rich result
Google's post of 8 August 2023 limited FAQ rich results to well-known, authoritative government and health websites. Other sites would no longer be shown that result regularly. The same post limited HowTo rich results to desktop, and said you could remove the markup but did not have to. Structured data Google is not using, that post said, does not cause problems for Search and has no visible effect there.
The update on that post, dated 14 September 2023, says that as of 13 September 2023 Google Search no longer shows HowTo rich results on desktop either, so the type is deprecated. The Search Central changelog for 14 September 2023 records that the HowTo documentation was removed because the result is no longer shown on mobile or desktop.
The changelog entry dated 8 May 2026 says the FAQ rich result will no longer appear in Google Search, starting 7 May 2026. The entry dated 15 June 2026 says the FAQ documentation was removed for that reason. The features gallery I read on 10 November 2026 does not list FAQ or HowTo.
A visible question and answer can still help a reader. That is page content. I would not add FAQPage or HowTo on a new template to chase a dropdown. If a template already prints FAQPage beside questions a person can open, the words in the script still have to match the words on the page. The 2023 "no need to remove it" line is about markup Google was not using then. I am not treating the May 2026 changelog as a repeat of that sentence. This site's service templates still print FAQPage next to the visible questions. I am not claiming that block produces a rich result.
Schema markup validation: two tools, two jobs
Schema markup validation is two checks. They do not grade the same thing.
Google's testing page says to start with the Rich Results Test to see which Google rich results the page can generate, and to use the Schema Markup Validator for generic schema.org validation, without Google-specific validation. The validator is the old Structured Data Testing Tool after Google removed its own feature checks and moved it to schema.org.
| Tool | What it checks | What a pass does not mean |
|---|---|---|
| Rich Results Test | Whether Google can build a rich result from types the tool supports | That Search will show it, or that every schema.org type is valid |
| Schema Markup Validator | Whether the markup matches the schema.org vocabulary | Eligibility for a Google rich result |
A page can pass one and fail the other.
- JSON that a parser rejects fails both, once the tool can say the document is broken. Google's troubleshooting sections point at the Unparsable structured data report for syntax errors.
- A
BreadcrumbListwithoutpositionis missing a property Google's breadcrumb docs require. That is a Rich Results Test problem. The Schema.org validator is not applying Google's required-property list. - A
FAQPageblock can still match schema.org and produce no Google rich result, because that feature is no longer shown. - A type the Rich Results Test does not support can still be in the rendered HTML. Google's JavaScript guide says Google can process structured data it finds there, and that "Page is eligible for rich results" is the message when the type is supported and the check passes.
A pasted snippet is not the page Google fetched. After deploy, use URL Inspection on the live URL. The URL has to be fetchable: not blocked by robots.txt, not noindex, not behind a login. Google's Article steps say to ship a few pages, inspect one, and allow time for recrawl. It says that can take several days. Search Console's rich-result report is the later check, for types that still have a report. I am not attaching one here.

Figure 2. The Rich Results Test judges Google features. The Schema.org Markup Validator judges the vocabulary. Run both, and fix the message you actually got.
Fix the errors
Match the message to the cause. I have not reproduced these messages in either tool for this article. The fixes below follow JSON syntax and the property rules in the docs linked above.
The script is not JSON
JSON does not allow comments, trailing commas, or single-quoted strings. A raw line break inside a string has to be escaped. Straight quotes that a document editor turned into curly quotes break the parse as well. This object is invalid because of the comma after the headline. It is here so the break is visible:
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": "Schema markup",
}
Delete that comma. Build the object in application code and encode it, so a quote in a title does not have to be escaped by hand. When the JSON is embedded in HTML, escape < so a string cannot close the script element. This site's layout replaces < with \u003c when it writes the layout graph. That is what the template source does. I have not fed a hostile string through it for this article.
The URL is relative, or the image cannot be fetched
Article image rules want crawlable absolute URLs. The breadcrumb examples use absolute item URLs, scheme and host included. /blog is not the same value as https://example.com/blog. Use the canonical host. One canonical is the same rule as in the technical SEO checklist. If robots.txt blocks the image, Google cannot use it. I do not disallow CSS, JavaScript, or images the template needs. That is the robots.txt guide.
The script and the page disagree
This is the failure a syntax check misses. The quality guidelines say the structured data has to represent the visible content, and that the Rich Results Test will not catch every case. I treat these as bugs: a price in the script that is not the price on the page, an author name that is not the byline, a review the business wrote and marked up as a user review, a logo where the article image should be. On a shop, the Product fields and the label have to share a source, which is the point of the Product section in technical SEO for ecommerce. An audit writes that row down with the evidence. That write-up is the technical SEO audit guide.
A required property is missing, or the type is wrong
Article has no required list. Add the recommended fields that apply. A breadcrumb ListItem does have a required list: position, and name and item, except item on the last entry. Counting positions from 0 does not match the docs, which start at 1.
Product rules depend on which Google feature you want, and they are stricter than a generic Product in the schema.org vocabulary. I am not restating them here. Use the ecommerce post for that split.
Author mistakes called out in the Article docs: several names in one author.name, Organization used for a person, the publisher's name stuffed into the author. A second BlogPosting in the body, on top of the one the template already prints, is the duplicate I remove. "Eligible for rich results" still does not mean Search will show it, and a schema.org pass does not mean the type is in Google's gallery. FAQ and HowTo are that case.
The order I follow
- Confirm the URL returns the HTML you mean:
200, one canonical, notnoindex, not disallowed. Markup on a URL you want removed is wasted work. Unknown paths on this site return410, which is the cleanup in how I removed hacked spam URLs from Google. - Pick a type from the features gallery that matches what a person can see. Do not pick FAQ or HowTo in order to get a rich result.
- Print one JSON-LD script from the same data as the visible template. Do not add a second Article node beside the template's
BlogPosting. - Run the Rich Results Test on the URL, and the Schema.org Markup Validator on the same markup. Fix the error each one names.
- Deploy a few URLs. Use URL Inspection, then the rich-result report for any type that still has one.
- Re-check after a template change. A new theme can drop the script without leaving a syntax error behind.
FAQ
Does schema markup guarantee a rich result?
No. The general guidelines say correct markup makes a feature possible and does not guarantee it. The Rich Results Test can report that a page is eligible, and Search can still show a text result.
What does schema markup validation actually check?
The Rich Results Test checks Google rich-result eligibility for types it supports. The Schema.org Markup Validator checks the schema.org vocabulary and does not apply Google's feature rules. Use both. A pass in one does not cover the other.
Should I add FAQ or HowTo JSON-LD for Google?
Not for a rich result. HowTo rich results ended on 13 September 2023. FAQ rich results were limited in 2023 to well-known, authoritative government and health sites, and from 7 May 2026 Google says that feature no longer appears. Keep a visible FAQ when readers need the answers.
Where should JSON-LD schema markup live?
In the HTML Google fetches, as a script with type application/ld+json, in the head or the body. Google can read a script that JavaScript adds. For product price and availability I still print it on the server, because the JavaScript guide warns that dynamic Product markup is a weaker input for Shopping crawls.
If you want the template checked
I am a senior software engineer in Lahore. The check is the live HTML: one script, the same words as the page, and a type Google still documents.
If the Rich Results Test and the page disagree, or a theme is printing a second Article, that is work I take under technical SEO services. I start from the HTML that was fetched.
