What is the difference between Schema.org's WebSite vs WebPage type?
Asked Answered
H

1

11

I was reading Google documentation on how to impletement Sitelinks Search Box. In the example, they use

itemscope itemtype="http://schema.org/WebSite"

to implement sub-properties like potentialAction, etc.

However, after reading the schema documentation CreativeWork it looks to me that WebSite is inferior to WebPage.

  • They inherit the same properites from CreativeWork
  • WebPage has its own properties, while WebSite doesn't

Is there a scenario where WebSite should be used / is preferable?

Hyder answered 26/4, 2015 at 20:40 Comment(0)
A
10

WebSite represents a web site, WebPage represents a web page (like the difference between Blog and BlogPosting).

The additional properties from WebPage (like breadcrumb and mainContentOfPage) wouldn’t necessarily make sense for WebSite.

Google’s Sitelinks Search Box uses WebSite because the search usually applies to the whole site, not just a single page.

Arnoldoarnon answered 27/4, 2015 at 6:59 Comment(7)
So what if I need to put WebSite on body to use potentialAction, but I also want props from WebPage? Can I nest these items?Hyder
@gskema: Yes, you can have several items in a document (it doesn’t matter if you nest them or not, unless you have a property to relate them).Arnoldoarnon
Still unclear to me on how to proceed. Should I maintain hierarchy and put WebSite on html or body once, and put WebPage once immediatelly after? Or should I use WebSite and WebPage multiple times whevever I need to put props of them?Hyder
Alos, take a look at this (might help) lists.w3.org/Archives/Public/public-vocabs/2014Apr/…Hyder
@gskema: It doesn’t matter if you use html or body or something else for your itemscope. The HTML5 hierarchy has no effect on the Microdata (it’s only relevant if you use Microdata properties to relate two items). So if you want to state some data about a webpage, use WebPage; if you want to state some data about a website, use WebSite; and if you want to state some data about both, use both. (Note that these don’t necessarily have to be about the current webpage/website, e.g., you could state something on your site about the WebSite with the url "http://stackoverflow.com/").Arnoldoarnon
One final question (I hope you don't mind): is it ok to microdata about the same element in two different places (meaning that I declare it twice)? For example, declaring WebSite and then potentialAction somewhere and then WebSite again somewhere else (about the same Website).Hyder
@gskema: That is technically not forbidden, but I’d recommend not to do it. In case of Microdata, its itemref attribute could be used in such a case.Arnoldoarnon

© 2022 - 2024 — McMap. All rights reserved.