Writing structured data is only half of the job. Before you paste a JSON-LD block into your website you need to check that it is correct, because a single missing comma or a wrong property name can make the whole block unreadable for search engines. This guide explains which validators exist, what each one checks and how to fix the errors you are most likely to meet.
The two tools you need
There are two official tools, and they answer different questions.
- Schema Markup Validator (validator.schema.org): maintained by the schema.org community, it checks that your code is valid against the schema.org vocabulary. It works with any type and does not care whether Google shows a feature for it. It replaced Google’s old Structured Data Testing Tool, which has been retired.
- Rich Results Test (search.google.com/test/rich-results): it tells you whether the page is eligible for Google rich results, and lists errors and warnings for the types Google supports.
Use the first one to make sure the code is valid, and the second when you are aiming at a specific search feature, such as a product listing.
How to validate your markup
- Generate your code with the free application on this site, for example the Organization schema generator. Each generator has a validate button that sends the code to the Schema Markup Validator.
- Open the validator and choose between testing a public URL or pasting the code snippet.
- Run the test and read the result. Errors must be fixed, while warnings describe recommended properties that are missing.
- Fix the code, test again, and only then add it to the head of your page.
- After publishing, test the live URL with the Rich Results Test to confirm the page serves the code you expect.
Valid does not mean eligible
Code can be perfectly valid and still produce nothing in Google Search. Validity means the syntax and the vocabulary are correct. Eligibility means the type is supported by a Google feature, the required properties are present and the information matches what visitors can see on the page. Even eligible pages are not guaranteed to get a rich result, because Google decides case by case.
The most common errors and how to fix them
- Missing or extra comma: JSON does not allow a comma after the last item of an object or list. Remove it.
- Unescaped quotes: a quote inside a text value must be written with a backslash in front of it.
- Unknown property: check the spelling and the capital letters. Property names are case sensitive.
- Wrong value type: a price must be a number or a numeric string, and a date should use the ISO format.
- Duplicate blocks: a theme and an SEO plugin may both print an Organization block. Keep one consistent version.
- Markup that does not match the page: data hidden from visitors or different from the visible content can lead to manual actions.
Keep monitoring after launch
Google Search Console shows reports for the structured data it finds on your site, and sends alerts when new errors appear. Check it after every redesign or plugin update, since templates often change the markup without anyone noticing. If you are not sure where to place the code, read how to insert a schema in the head section of your website, and for a map of the types worth creating first, see the most important schema.org types.