Validation and testing
Structured data can be checked at two levels. A schema.org validator checks that the syntax is correct and that the types and properties exist in schema.org. A search engine test checks whether the markup meets that search engine's requirements for a feature. Google provides the Rich Results Test for its features,[1] and schema.org hosts the Schema Markup Validator for general schema.org checking.[2]
Which tool checks what
| Tool | Run by | Checks | Notes |
|---|---|---|---|
| Rich Results Test | Which Google rich result types a page or code snippet is eligible for, with errors and warnings[1] | Supports JSON-LD, RDFa and Microdata[1] | |
| Schema Markup Validator | Schema.org (built from Google's former testing tool) | Syntax and compliance with schema.org; no Google rich result checks[2] | Useful for types Google does not consume[2] |
| URL Inspection tool | Google Search Console | Catches most technical errors along with the Rich Results Test[3] | For pages on a verified site |
| Rich result status reports | Google Search Console | Validity of marked-up pages after deployment[4] | Detects breakage from templating or serving issues[4] |
Google Rich Results Test
The Rich Results Test accepts a URL or a code snippet. For a URL, all page resources must be accessible to an anonymous user; pages behind a firewall or password are not available, and a page on a local machine can be tested through a tunnel.[1] For a snippet, choose Code instead of URL and paste the code; it can be edited and rerun as often as needed.[1] The test can use a smartphone or desktop user agent; smartphone is the default "as this is how the majority of users browse the web today."[1]
The tool accesses pages as Google-InspectionTool, not with the user's credentials, so robots.txt can block it; pages that Google is prevented from crawling, for example by robots.txt or noindex, cannot be tested.[1] Results show which rich result types were found, with errors or suggestions; the possible statuses range from "N valid item(s) detected" through "N invalid item(s) detected" to "URL cannot be crawled" and "Structured data with syntax errors detected."[1]
Google's JavaScript guide says a correct implementation of a supported type shows the message "Page is eligible for rich results." If errors or warnings appear, it is "most likely a syntax error or a missing property." For types the test does not support, check that the rendered HTML contains the structured data.[5]
Schema Markup Validator
In December 2020 Google announced that, instead of retiring the Structured Data Testing Tool, it would refocus it and migrate it "to a new domain serving the schema.org community by April 2021." Its main purpose would be "to check syntax and compliance of markup with schema.org standards," and it would no longer check for Google Search rich result types.[2] Google's example: to check Event markup for Google's event features, use the Rich Results Test and Search Console; to check that schema.org properties are valid, or to validate a type Google does not consume, such as ExercisePlan, use the schema.org validator.[2] Schema.org's releases page announced in 2021 that the Schema Markup Validator at validator.schema.org was available for review.[6]
After launch
Google advises testing with the Rich Results Test during development and using the rich result status reports after deployment, because pages "might break after deployment due to templating or serving issues."[4] Its local business guide suggests deploying markup on a few pages first and checking them with the URL Inspection tool.[7]
Errors and warnings
An error usually means an item is not eligible for a feature: Google's completeness rule says items missing required properties are not eligible for rich results.[3] The Rich Results Test can also report items as valid with warnings, which it distinguishes from invalid items.[1] On recommended properties, Google says more of them can improve the result for users, but complete and accurate data matters more than quantity.[3][4] Some recommended properties do not trigger warnings at all; Google says the Rich Results Test does not warn about Article dateModified because it is recommended only where applicable.[8]
Common problems Google's documentation identifies include:
- comments left inside JSON-LD, which the Rich Results Test ignores but the JSON-LD standard does not allow;[1]
- a comma used as a decimal separator in a rating instead of a dot;[9]
- a priceRange of 100 characters or more, which Google will not show;[7]
- a reviewer name that is not a valid name, such as "50% off until Saturday", or one longer than 100 characters;[9]
- a logo smaller than 112 by 112 pixels or not crawlable and indexable;[10]
- geo coordinates with fewer than 5 decimal places in local business markup.[7]
Bing says its crawlers validate annotated data against the schema and data types, and ignore it when, for example, a price is a date; an event without a date or a person without a name is also ignored.[11]
Common questions
Is the Structured Data Testing Tool still available?
Google refocused it as the Schema Markup Validator on a schema.org domain, which no longer checks Google rich result types.[2]
Can I test code that is not published yet?
Yes. The Rich Results Test accepts a pasted code snippet.[1]
Does passing the Rich Results Test guarantee a rich result?
No. Google says correct markup still does not guarantee a rich result.[3]
Related topics
References
- ^ "Rich Results Test (Search Console Help)". Google Search Console Help.
- ^ "An update on the Structured Data Testing Tool (December 15, 2020, updated 2021)". Google Search Central Blog.
- ^ "General structured data guidelines". Google Search Central.
- ^ "Introduction to structured data markup in Google Search". Google Search Central.
- ^ "Generate structured data with JavaScript". Google Search Central.
- ^ "Release listing". Schema.org.
- ^ "Local business (LocalBusiness) structured data". Google Search Central.
- ^ "Article (Article, NewsArticle, BlogPosting) structured data". Google Search Central.
- ^ "Review snippet (Review, AggregateRating) structured data". Google Search Central.
- ^ "Organization (Organization) structured data". Google Search Central.
- ^ "Marking up your site with structured data: Overview". Bing Webmaster Tools.