1

I am trying to add Microdata into my site to help search engines understand my content. The WebSite definition requires a property called url. I am puzzled on which URL I should have here. Should the url be the URL to the main page or the current page being rendered?

For example, if I want to create Microdata for https://example.com/i/12/some-tag. Would the url then be https://example.com or the canonical URL (i.e., https://example.com/i/12/some-tag)?

unor
  • 92,415
  • 26
  • 211
  • 360
Junior
  • 11,602
  • 27
  • 106
  • 212
  • Note that Schema.org does not require any property; the page lists all properties that can be used, but they don’t have to be used. -- A specific consumer, e.g. Google Search, might have certain requirements for certain features they offer, though. – unor Sep 24 '19 at 07:31

1 Answers1

1

The url of the WebSite should be the website’s homepage.

If you want to provide structured data about the current page, you can use WebPage and its url property.

<!-- on https://example.com/i/12/some-tag -->

<body itemscope itemtype="http://schema.org/WebPage">
  <link itemprop="url" href="https://example.com/i/12/some-tag" />

  <div itemprop="isPartOf" itemscope itemtype="https://schema.org/WebSite">
    <link itemprop="url" href="https://example.com/" />
  </div>

</body>

For the homepage itself, the WebSite and the WebPage would have the same url value. By giving each item its own URI as identifier (via Microdata’s itemid attribute), you can differentiate between these two (and all other) items. See this answer for details.

unor
  • 92,415
  • 26
  • 211
  • 360
  • Currently, I have `` after adding the info you provided, is that still needed? – Junior Sep 24 '19 at 19:10
  • @Junior: You should not have more than one `WebSite` item per document. It doesn’t matter on which element you specify it (`html`, `body`, a `div` etc.). – unor Sep 24 '19 at 22:30
  • If you can only have one Website defined per document, how to your refer to multiple websites that your web page is talking about? – Scott M. Stolz Apr 29 '20 at 13:56