2

I would like to insert WebPage markup in my code. So it's written that this - itemscope="" itemtype="http://schema.org/WebPage" - should be put into body tag. But in body tag I have id="top-page".

When I copy the Microdata line to the body and test it with Google’s tool, it shows me http://xxxx.yy/top-page as @id.

How to avoid it?

unor
  • 92,415
  • 26
  • 211
  • 360
Hubert Kubasiewicz
  • 365
  • 1
  • 3
  • 16
  • Can you please elaborate what you mean saying _"shows me `http://xxxx.yy/top-page`"_? Where does it show, and what you expect? – Alex Shesterov Mar 29 '17 at 10:52
  • Thank You for You message. So one again I am trying to insert WebPage markup in my code. On https://schema.org/WebPage it's written that to do it the body tag should look like this but my body tag has id="top-page" and when I make , load it to the server and after that test my page with the markup tool from google webmaster tools, the tool shows me @id http://xxxx.yy/page-top which is wrong. And I think the tool should show - http://xxxx.yy - without page-top. – Hubert Kubasiewicz Mar 29 '17 at 11:04

1 Answers1

3

This is most likely a bug in Google’s tool. You don’t have to worry about it. But if you do, there are two workarounds:

  • Specify itemid on body in addition. This is the correct attribute responsible for providing an ID in Microdata, not id. You should provide the canonical URL of the web page as value.

  • Specify itemscope itemtype="http://schema.org/WebPage" on a different element (one that doesn’t have an id attribute). While it’s often useful to specify WebPage on the body, this is not required.

The first solution is preferable, as it’s generally a good practice to provide IDs for your structured data items.

Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360