2

I understand that there's a very well-written answer to a similar question here How to implement "mainEntityOfPage" to this specific site? but I'm still quite confused and could use some help.

So the website I'm building is a corporate website for a local business, and it has many different sections—one of which is an Articles area (news, features, whitepapers, etc.).

Now, this is the first time I'm using Schema so please bear with me.

I've set it up so that the entire website itself is inside the LocalBusiness (via some judicious meta-tagging within the header of my page-template). Everything works on that end, and it checks out perfectly on the Google Validator (i.e. Structured Data Testing Tool).

My issue is that for the ARTICLE pages, I have a special template for its content. So the content of the article page itself is within a <div itemscope itemtype="http://schema.org/Article">, and I've been able to successfully encode all the other metadata required for a good Article.

My only concern is that Google recommends I have the mainEntityOfPage property.

From how I understand, this tag would tell crawlers that although there might be multiple major types on the page (in this case, LocalBusiness and Article), one takes precedence.

Did I get it right?

If I did, then how do I use it? Do I add a new meta or link tag within the Article content area?

I saw that the recommended method is to add a <link itemprop="mainEntityOfPage" href="http://example.com/article-1" /> tag. How does this work? Should I put it within the scope of the Article itemscope (i.e. inside the article content template)? So the URL should point to this very same page?

Please help!

Community
  • 1
  • 1

1 Answers1

1

Just like an Article could have a name or a description, it can have a mainEntityOfPage. So yes, it has to be within the scope of the Article, otherwise it wouldn’t be the mainEntityOfPage of that item, of course.

To add it under its scope, you can either add the element as descendant, or you can use the itemref attribute if you want to place the element somewhere else.

<article itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="/articles/42" />
</article>
<link id="page-url" itemprop="mainEntityOfPage" href="/articles/42" />

<article itemscope itemtype="http://schema.org/Article" itemref="page-url">
</article>

And yes, on the article page, the value of the mainEntityOfPage property would be the current URL.

From how I understand, this tag would tell crawlers that although there might be multiple major types on the page (in this case, LocalBusiness and Article), one takes precedence.

Something like that, but not necessarily "precedence". What the mainEntityOfPage conveys is:

"This Article is the main entity described on the page available under that URL."

What to make of this information is up to the crawler. While it’s typically easy for humans to understand what the primary and secondary things on a page are (e.g., the full text article in the main column vs. related articles in the sidebar), this is not necessarily easy for bots. Using mainEntity/mainEntityOfPage is the solution do explicitly convey this within Schema.org.

unor
  • 92,415
  • 26
  • 211
  • 360