1

I've recently been looking at the schema vocab for describing the layout of a webpage.

The easiest and most obvious item to implement is the WebPage tag.

If you're just assigning http://schema.org/WebPage to a page, then adding it to the body tag makes sense.

However suppose your page is a search results page or a profile page, there are two relevent WebPage sub types for those cases:

My instinct is that you'd replace WebPage with the correct sub category in the body tag, however often when I come across implementations of this, for example the following theme, it recommends putting the sub categories separately inside the webpage object.

Is this correct, or should you replace a more general item with a more specific one when you can?

1 Answer 1

1
  • If your web page is a search results page, simply use SearchResultsPage instead of WebPage.

    It’s a hierarchy. Each child inherits from all its ancestors. So a SearchResultsPage is a more specific WebPage, which is a more specific CreativeWork, which is a more specific Thing.

    Always go with the most specific type that applies to your case. On a type’s page, the more specific types are linked in the bottom under the "More specific Types" section.

  • If your web page is both, a search results page and a profile page (which is rather unlikely … even if the profile shows all the author’s posts, it’s not really a search, is it?), use both types, ProfilePage and SearchResultsPage.


putting the sub categories separately inside the webpage object

It depends on how exactly the "sub" items are specified.
If they are added with a property, they are related to the parent item (and the property specifies the kind of relationship).
If they are not added with a property, they have no relation, each item is on its own.

1
  • Cheers, I was reasonably sure it was a hierarchy but there's enough conflicting information out there that it's easy to get a little bit lost. Commented Apr 15, 2015 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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