Fabrizio Mesto
Fabrizio Mesto

Reputation: 3

AMP-HTML page not pass validation in Structured Data Testing Tool

My page does not pass the AMP-HTML validation in Structured Data Testing Tool

https://developers.google.com/structured-data/testing-tool?url=http%253A%252F%252Fwww.fantaformazione.com%252F%253Fid%253D100%2526amp%253D1

If I copy the same html code in Structured Data Testing Tool it pass validation. Why?

My page is: http://www.fantaformazione.com/?id=100&amp=1

Upvotes: 0

Views: 206

Answers (2)

AM Douglas
AM Douglas

Reputation: 1903

AMP pages have stricter requirements of their structured data.1

The reason your snippet failed validation was due to the fact that NewsArticle images must be at least 696px wide:2

image (required) : The representative image of the article.

Only a marked-up image that directly belongs to the article should be specified.

  • Images should be at least 696 pixels wide.
  • Images should be in .jpg, .png, or .gif format.
  • Image URLs should be crawlable and indexable.

So simply increasing the reported width to 696px or over would probably have caused your markup to validate, though you should report the real dimensions to be on the safe side.


1 “Top Stories with AMP”

2 “Top Stories with AMP → Markup Specification”

Upvotes: 3

Jay Gray
Jay Gray

Reputation: 1726

This works:

https://gist.github.com/jaygray0919/8b5d86fc63ff6ea3656f0a0253fc31e7

Make sure that your image sizes are accurate. Note that I used the accurate values for Mertens1.jpg. You may re-scale them in CSS - or let Google do it dynamically - but provide accurate data in the JSON-LD island.

Also make sure that the size properties are ordered by width and then height.

Upvotes: 1

Related Questions