I implemented the following SEO markup on news article pages (around article text): <div class="articleBody" itemscope="" itemtype="https://schema.org/NewsArticle">

Is this implementation enough? Is this good for SEO?

On other sites I see <html lang="it" itemscope itemtype="http://schema.org/NewsArticle"> or <script type="application/ld+json"> with "@context": "https://schema.org", "@type": "NewsArticle"

So I am not sure if my implementation is correct or needs to be changed.


I should note at the outset of this answer that individual preferences may vary and there may be others here who would like to advocate very strongly for Microdata.

But my direct experience (having worked with both JSON-LD and Microdata and RDFa) is that - in the interests of future maintainability, not least - if you are currently making an early decision as to use either Microdata (or RDFa) or JSON-LD, I would definitely lean towards JSON-LD.

In future, you (or other maintainers) will want to make changes to your Semantic Data at some point.

Consequently, keeping your Semantic Data separated from - rather than interwoven with - your Markup is a sensible choice. (No less sensible than keeping your CSS and your JS separated from your HTML).

Additionally, it's (arguably) much more straightforward to update JSON computationally than it is HTML + Microdata. And computational updates can often be faster, more efficient and more accurate than handwritten updates.

If you do decide to go with JSON-LD rather than Microdata, the example of NewsArticle at schema.org is a textbook example:

<script type="application/ld+json">
       "@context": "https://schema.org",
       "@type": "NewsArticle",
       "url": "http://www.bbc.com/news/world-us-canada-39324587",
          "name":"BBC News",
       "headline": "Trump Russia claims: FBI's Comey confirms investigation of election 'interference'",
       "mainEntityOfPage": "http://www.bbc.com/news/world-us-canada-39324587",
       "articleBody": "Director Comey says the probe into last year's US election would assess if crimes were committed.",

Source: https://schema.org/NewsArticle

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.