Fixed Invalid Structured Data Item In AMP HTML 2018 - KhalistaBlog -->
Skip to content Skip to sidebar Skip to footer

Fixed Invalid Structured Data Item In AMP HTML 2018

Fixed Invalid Structured Data Item In AMP HTML - Unstructured or invalid structured data item (Missing or invalid structured data item) - A recent notification appears in Google Search Console for AMP that Missing or invalid structured data item on the AMP page. Whereas when checked on Structured Data Testing Tool does not show any error data blog structure.

Surely this instantly makes the forehead shrink, confused what should be corrected because the Structured Data Testing Tool no error data structure but got a notification from Google Search Console for Structured data items not exist or invalid.

It turns out that existing data structures do not match the needs of AMP. For that we need to change the data structure to match the AMP's suggestion that the page has a valid AMP structured data. To correct the invalid structured data item on this AMP page, we need to change the existing data structure to the AMP's recommendation.

Fixed Invalid Structured Data Item In AMP HTML


The first thing to do is remove all schema.org elements like or similar like the following.
itemprop='mainContentOfPage' itemscope='
itemscope' itemtype='https://schema.org/.....

Example:
<body itemscope='itemscope'
itemtype='https://schema.org/WebPage'>

Once edited:
<body>

Or an example:
<div itemprop='mainEntity' itemscope='itemscope'
itemtype='https://schema.org/WebSite'>

Once edited:
<div>

Once that concerns all schema.org elements like the above example edited, then please create and adjust as follows. For the blog then we take the data structure of the article, this time with microdata.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<HTML expr:dir='data:blog.languageDirection' itemscope='' itemtype='http://schema.org/NewsArticle' lang='id'>
&lt;head&gt;
<meta charset='utf-8'/>
<meta content='width=device-width,minimum-scale=1,initial-scale=1' name='viewport'/>
<meta content='IE=9; IE=8; IE=7; IE=EDGE; chrome=1' http-equiv='X-UA-Compatible'/>
<b:if cond='data:blog.pageType == &quot;index&quot;'>
    <title><data:blog.pageTitle/></title>
<b:else/>
    <b:if cond='data:blog.pageType == &quot;error_page&quot;'>
        <title>404: Page Not Found | <data:blog.title/></title>
    <b:else/>
        <title><data:blog.pageName/></title>
    </b:if>
</b:if>
...................
...................
...................
<style amp-custom='amp-custom'>
/*<![CDATA[*/
body{background:#f1f1f1;margin:0;}
...................
...................
...................
/*]]>*/
</style>
<style amp-boilerplate='amp-boilerplate'>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate='amp-boilerplate'>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<script async='async' src='https://cdn.ampproject.org/v0.js'/>
...................
...................
...................
&lt;/head&gt;&lt;!--<head/>--&gt;
<body>
     <div id='main-wrapper'>
...................
...................
...................
            <b:includable id='post' var='post'>
  <article class='post hentry'>
<b:if cond='data:post.firstImageUrl'>
<div itemprop='image' itemscope='itemscope' itemtype='https://schema.org/ImageObject'>
  <meta expr:content='resizeImage(data:post.firstImageUrl,800,&quot;1:1&quot;)' itemprop='url'/>
  <meta content='800' itemprop='width'/>
  <meta content='800' itemprop='height'/>
  </div>
<b:else/>
<div itemprop='image' itemscope='itemscope' itemtype='https://schema.org/ImageObject'>
  <meta content='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMfJQ6E6QT1HpGsAwfaUbQp7QA3wiWMlTYQobAmPM47UgLOBQ6me69iZKYSkGh8E2ChHvp8CIO-jGR-Gb9JEzeyyHhFnZ4xpHHs6G6Q7lQtdmGT8L27Tle81sB83qabJ2bOnEaYIHUJas/s800-c/no-thumbnail.jpg' itemprop='url'/>
  <meta content='800' itemprop='width'/>
  <meta content='800' itemprop='height'/>
  </div>
    </b:if>
  <div itemprop='publisher' itemscope='itemscope' itemtype='https://schema.org/Organization'>
    <div itemprop='logo' itemscope='itemscope' itemtype='https://schema.org/ImageObject'>
      <meta content='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjra-kf51LxGbozGCkCF51IcPvPrIQIovuwG5-vOXHCkIuRetvzgaPiLu8p8H_NHzmCFROf5ctPw3r_LKDvXoTsBo8rFrvejwrnV2RZdXvOGtersYzcTIe6N1P8FmMzX4_oT8bwrU8ZCww/s1600/Khalista.png' itemprop='url'/>
      <meta content='600' itemprop='width'/>
      <meta content='60' itemprop='height'/>
    </div>
    <meta expr:content='data:blog.title' itemprop='name'/>
  </div>
...................
...................
...................

    <b:if cond='data:blog.pageType != &quot;item&quot;'>
<b:if cond='data:post.title'>
      <h2 class='post-title entry-title' itemprop='headline'>
     <b:if cond='data:post.link'>
       <a expr:href='data:post.link' expr:title='data:post.title' itemprop='url mainEntityOfPage'><data:post.title/></a>
     <b:else/>
        <b:if cond='data:post.url'>
          <a expr:href='data:post.url' expr:title='data:post.title' itemprop='url mainEntityOfPage'><data:post.title/></a>
        <b:else/>
          <data:post.title/>
        </b:if>
     </b:if>
      </h2>
</b:if>
<b:else/>
      <h1 class='post-title entry-title' itemprop='headline'>
     <b:if cond='data:post.link'>
       <a expr:href='data:post.link' expr:title='data:post.title' itemprop='url mainEntityOfPage'><data:post.title/></a>
     <b:else/>
        <b:if cond='data:post.url'>
          <a expr:href='data:post.url' expr:title='data:post.title' itemprop='url mainEntityOfPage'><data:post.title/></a>
        <b:else/>
          <data:post.title/>
        </b:if>
     </b:if>
      </h1>
</b:if>
...................
...................
...................
<b:if cond='data:blog.pageType == &quot;item&quot; and data:blog.metaDescription'>
<meta expr:content='data:blog.metaDescription' itemprop='description'/>
<meta expr:content='data:blog.metaDescription' property='twitter:description'/>
<b:else/>
<meta expr:content='data:post.snippet' itemprop='description'/>
<meta expr:content='data:post.snippet' property='twitter:description'/>
</b:if>
    <div class='post-body entry-content' expr:id='&quot;post-body-&quot; + data:post.id' itemprop='articleBody'>
<b:if cond='data:blog.pageType != &quot;item&quot; and data:blog.pageType != &quot;static_page&quot;'>
<h3 class='post_meta'>
<b:include data='post' name='author-post'/>
  </h3>
<div class='snippets'><data:post.snippet/></div>
</b:if>
<b:if cond='data:blog.pageType == &quot;item&quot; or data:blog.pageType == &quot;static_page&quot;'>
  <data:post.body/>
</b:if>
      <div class='clear'/> <!-- clear for photos floats -->
    </div>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div class='postmeta'>
<h3 class='date-header'>
<b:include data='post' name='author-post'/>
</h3>
</div>
...................
...................
...................
<div class='clear'/>
  </article>
</b:includable>
...................
...................
...................
          </b:widget>
        </b:section>
      </div>
<aside>
...................
...................
...................
</aside>
      <!-- spacer for skins that want sidebar and main to be the same height-->
  <div class='clear'/>
  </div>
<footer>
<div class='credit-wrapper'>
<div class='credit-left'>
Copyright &#169; 2018 <a expr:href='data:blog.homepageUrl' expr:title='data:blog.title'><data:blog.title/></a> - Proudly powered <a href='//www.blogger.com' title='Blogger'>by Blogger</a>
</div>
</div>
</footer>
&lt;!--</body>--&gt; &lt;/body&gt;
</HTML>

For blog logo please create an image with size 600x60 can with format jpg, png, or gif. Then please replace the code I marked above. To create a blog logo please follow here.

Once everything is done, please check the AMP data structure validation here.
If it is valid it will look like the picture below.

Fixed Invalid Structured Data Item In AMP HTML 2018

After that please do Validate Fix in Google Search Console and wait for Google to validate our blog AMP page.

Attention:
For AMP required a large post thumbnail at 800px range. So for the pictures for post thumbnail make 800x800 for thumbnail box or 1400x800 for square thumbnail.

It's the article I've shared about Improving Invalid Structured Data Items In AMP HTML. Hopefully with a short enough article this can be useful and good luck.

2 comments for "Fixed Invalid Structured Data Item In AMP HTML 2018"

  1. thank's, I got rid of the missing data item problem, but now I want to have the second option. (page has valid structured data) How can I do that? Thank you so much in advance

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete

Provide comments relevant to the posted articles and provide critiques and suggestions for the progress of the blog