AMP validation error – “Error in required structured data element”
-
December 30, 2020 at 2:11 pm #4888[anonymous]
Google Search Console has sent me an error for one of my web pages.
The error is “Error in required structured data element” and appears on only for this one page (so far at least!). No further details are provided except a link to the explanatory text
https://developers.google.com/search/docs/data-types/article
I did a quick manual check of the article structured data element in the affected page and it appears ok to me. I tried removing the “description” element as I could not see this in the specification, but this made no difference.
Any thoughts?
<script type="application/ld+json">{ "@context":"http://schema.org", "@type":"Article", "mainEntityOfPage":{ "@type":"WebPage", "@id":"https://www.fullonecommerce.com/amp/three-developer-friendly-ecommerce-platforms-you-may-not-have-heard-of.html"}, "headline":"Three developer-friendly ecommerce platforms you may not have heard of", "datePublished":"2020-12-04T15:49", "dateModified":"2020-12-18T11:38", "description":"Three developer-friendly ecommerce platformsThis article introduces you to three developer-friendly ecommerce platforms that may fit your needs without having to resort to the ones everyone has heard of (like BigCommerce, Salesforce Commerce Cloud and Shopify - all of which are members of our ecommerce platform…", "author":{"@type":"Person","name":"M Ryan"}, "publisher":{"@type":"Organization","name":"M Ryan"} }</script>
January 3, 2021 at 4:15 pm #4925[anonymous]Hi,
I have validated your current JSON+LD code from the linked article:
<script type="application/ld+json">{"@context":"http://schema.org","@type":"Article","mainEntityOfPage":{"@type":"WebPage","@id":"https://www.fullonecommerce.com/amp/three-developer-friendly-ecommerce-platforms-you-may-not-have-heard-of.html"},"headline":"Three developer-friendly ecommerce platforms you may not have heard of","datePublished":"2020-12-04T15:49","dateModified":"2020-12-18T11:38","image":{"@type":"ImageObject","url":"https://www.fullonecommerce.com/media/website/logo.png","height":82,"width":350},"description":"Three developer-friendly ecommerce platformsThis article introduces you to three developer-friendly ecommerce platforms that may fit your needs without having to resort to the ones everyone has heard of (like BigCommerce, Salesforce Commerce Cloud and Shopify - all of which are members of our ecommerce platform…","author":{"@type":"Person","name":"M Ryan"},"publisher":{"@type":"Organization","name":"M Ryan","logo":{"@type":"ImageObject","url":"https://www.fullonecommerce.com/media/website/logo.png","height":82,"width":350}}}</script>
and it looks correct now: https://search.google.com/structured-data/testing-tool/u/0/
January 3, 2021 at 4:54 pm #4928[anonymous]Thank you, yes, Google has validated it now, however I have found further details on a new error “AMP HTML Tag has an invalid layout specified by its attributes.” and confirmed by using the Google-provided AMP Test Tool at https://search.google.com/test/amp
for the following page:
https://www.fullonecommerce.com/amp/ecommerce-terminology-the-complete-guide.html
The reported error is:
The mandatory attribute ‘height’ is missing in tag ‘amp-img’.and shows the following source code snippet:<amp-img src="https://www.fullonecommerce.com/media/posts/27/bhphotosupermenu-2.png" sizes=
Looking inside Publii at this image, the height and width are missing from this particular image. So, no surprises the error is generated, but perhaps Publii could issue a warning if you enable AMP and have pages without height and width set?
January 4, 2021 at 10:39 am #4947[anonymous]Hi,
When plugins will be available for Publii (probably Q2 this year) we will prepare a tool for detecting such issues. At this moment you have to rely on Google Search Console for such purpose (but in fact for such purposes GSC has been created :)).