0

I have this:

<span itemscope itemtype="http://schema.org/NewsArticle">

    <meta itemprop="mainEntityOfPage" content="true">

    <span itemprop="author publisher" itemscope itemtype="https://schema.org/Organization">
      <meta itemprop="url" content="http://axample.com.br">
      <meta itemprop="name" content="axample">
      <link itemprop="sameAs" href="https://facebook.com/axample" />
      <link itemprop="sameAs" href="https://twitter.com/axample" />
      <link itemprop="sameAs" href="https://www.instagram.com/axample" />
      <span itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
        <meta itemprop="url" content="http://axample.com.br/axample.png">
        <meta itemprop="width" content="151">
        <meta itemprop="height" content="60">
      </span>
    </span>

    <span itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
      <meta itemprop="url" content="http://axample.com.br/axample.png">
      <meta itemprop="width" content="200">
      <meta itemprop="height" content="150">              
    </span>
    <meta itemprop="description" content="A description">
</span>

I use a JavaScript to get the meta tags and insert on JASON-LD. I'm using the Element DOM on Google Tag Mannger and I configured the Element DOM to get the meta[itemprop="url"]. This will get the first meta tag that has the itemprop="url".

I heard that there's a correct order to put the markup in HTML, then I was thinking if I can duplicate the meta tag from the ImageObject and put it above.

<span itemprop="image" itemscope itemtype="http://schema.org/ImageObject">   //duplicated
  <meta itemprop="url" content="http://axample.com.br/axample.png">         //duplicated
  <meta itemprop="width" content="200">                                    //duplicated
  <meta itemprop="height" content="150">                                  //duplicated        
</span>
<meta itemprop="description" content="A description">

<span itemscope itemtype="http://schema.org/NewsArticle">

    <meta itemprop="mainEntityOfPage" content="true">

    <span itemprop="author publisher" itemscope itemtype="https://schema.org/Organization">
      <meta itemprop="url" content="http://axample.com.br">
      <meta itemprop="name" content="axample">
      <link itemprop="sameAs" href="https://facebook.com/axample" />
      <link itemprop="sameAs" href="https://twitter.com/axample" />
      <link itemprop="sameAs" href="https://www.instagram.com/axample" />
      <span itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
        <meta itemprop="url" content="http://axample.com.br/axample.png">
        <meta itemprop="width" content="151">
        <meta itemprop="height" content="60">
      </span>
    </span>

    <span itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
      <meta itemprop="url" content="http://axample.com.br/axample.png">
      <meta itemprop="width" content="200">
      <meta itemprop="height" content="150">              
    </span>
    <meta itemprop="description" content="A description">
</span>

I saw this duplicated meta tag on another popular website in my country.

  • Why do you want to do this? – unor Oct 2 '18 at 2:21
0

Your statement "I use a JavaScript to get the meta tags and insert on JASON-LD." confuses me. If you already have the Schema.org mark up in your page(s) in Microdata format, the search engines will consume it.

Schema.org is valid in all three formats: Microdata, RDFa, JSON-LD. If it is already in one format there is no need to convert it to another.

Yes, Google prefer you use JSON-LD but that is a preference not a requirement.

Also, although you can mix formats on a single page, you should not repeat the same data in multiple formats. (looking for where that is stated but can't find a link at the moment)

As to statement ordering, yes it is important but only to ensure that the itemprops are nested within the appropriate itemscope.

The effect of the [2nd] code you show is to say that there are two ImageObjects. One is just a random ImageObject definition, the other being the image of the NewsArticle - which doesn't make sense.

If you want to indicate that a particular entity is the most important (from many) on a pagemainEntity property.

Hope this helps.

BTW 'true' is not an expected value for mainEntityOfPage

  • BTW 'true' is not an expected value for mainEntityOfPage Then why i see it on some websites? I see it on JSON-ld and on inline markup. – Natalie Oct 2 '18 at 16:04
  • It's also on Washington Post – Natalie Oct 2 '18 at 17:16
  • Being used that way does not mean it's correct. Check the provided link for the specification. – Tony McCreath Oct 2 '18 at 23:55
  • @TonyMcCreath Yea, i searched a little and most websites put a URL on the mainEntityOfPage, then i really don't know why some famous websites would use true on it. – Natalie Oct 3 '18 at 1:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.