1

I'm trying to apply rich snippet data to my web page, following http://schema.org/Article standards. One of the properties is articleBody, which I expect should include the entire body of text that comprises the article.

Unfortunately, the article's HTML representation is spotted with occasional buttons, ads and other hints, which has text that should not go into the articleBody.

For example:

<div itemscope itemtype="http://schema.org/Article">
  <div itemtype="articleBody">
    <p>1st Paragraph</p>
    <p>2nd paragraph</p>
    <a>A few useful links for my users</a>
    <p>3rd paragraph</p>
    <div>A few text ads</div>
    <p>4th paragraph</p>
  </div>
</div>

Is there a way to exclude the texts in the ads/links from the article itself?

unor
  • 92,415
  • 26
  • 211
  • 360
Camelhive
  • 55
  • 1
  • 7
  • Note that you have an error in your code: `itemtype="articleBody"` should be `itemprop="articleBody"`. – unor Oct 19 '13 at 21:43

1 Answers1

1

No, Microdata doesn’t offer a way to exclude content.

articleBody’s value will be the textContent of the element.


An ugly "hack" would be to specify several articleBody properties for this item:

<div itemscope itemtype="http://schema.org/Article">
  <div itemtype="articleBody">
    <p>1st Paragraph</p>
    <p>2nd paragraph</p>
  </div>
    <a>A few useful links for my users</a>
    <p itemtype="articleBody">3rd paragraph</p>
    <div>A few text ads</div>
    <p itemtype="articleBody">4th paragraph</p>
  </div>
</div>

But note that Microdata does not define how those values should be interpreted, so it’s up to the consumers.


Another ugly method:

Duplicate the information, contained in a meta element:

<div itemscope itemtype="http://schema.org/Article">
  <div>
    <p>1st Paragraph</p>
    <p>2nd paragraph</p>
    <a>A few useful links for my users</a>
    <p>3rd paragraph</p>
    <div>A few text ads</div>
    <p>4th paragraph</p>
  </div>
  <meta itemtype="articleBody" content="1st Paragraph. 2nd paragraph. 3rd paragraph. 4th paragraph." />
</div>
Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360