1

Have I misunderstood what mainEntityOfPage represents in schema.org?

I thought it told user-agents what the parent page of a given entity is, if the entity being described by structured data is the main entity of a given page.

But every time I mark up in JSON-LD an entity which is not the main entity, Google Structured Data Testing Tool warns me:

The mainEntityOfPage field is recommended. Please provide a value if available.

So I get multiple repeated warnings recommending that each non-main entity should have a mainEntityOfPage entry.

Which... makes no sense at all.

Unless I have misunderstood what mainEntityOfPage represents in schema.org.

Am I allowed to include something like:

"mainEntityOfPage": "false"

Example:

<body>
    <h1>I am a Webpage</h1>
    <p>I am an introduction to the webpage.</p>

    <article>
        <h2>Article One</h2>
        <p>As an article I am very important. In fact, I am the Main Entity of this Webpage</p>
    </article>

    <article>
        <h2>Article Two</h2>
        <p>I am another article on this Webpage, but I am not as important as Article One</p>
    </article>
</body>

When I add structured data in JSON-LD about Article Two, I see the error:

The mainEntityOfPage field is recommended. Please provide a value if available.

which (I think?) is saying - you need to tell me: Article Two is the Main Entity of... what page?

But... Article Two isn't the Main Entity of anything. It is a less important entity of the webpage for which Article One is the Main Entity.

1

Like it’s the case with most of the warnings/errors from the SDTT, this warning is only relevant if you want to get a specific rich result.

In this case, it seems to be for Google’s Articles rich result, which recommends to use mainEntityOfPage on AMP pages. If you don’t use AMP, or if you can’t provide all of the required properties, or if you don’t care about the rich result, you can ignore the warning.

Your understanding of mainEntityOfPage seems to be correct, and your use seems to be correct, too: only provide it for articles that are the primary entity on some page.

I think your case is unusual, though. Typically each article has a dedicated page. This page might provide data about additional articles (show teasers etc.), but these additional articles all would have their own page somewhere.

If you really have a page with two articles, and neither of these articles has another dedicated page, and both articles are self-contained, and the page is primarily only about one of these articles, then your structured data should be fine.

  • A brilliant answer, @unor - thank you very much indeed. You answered my main question and also my lurking suspicion (is Google generally anticipating no more than one article per page...?) – Rounin says Je suis Monica Nov 27 '17 at 8:41

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.