Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

Adding SCHEMA namespace to html tag correctly

5:09 am on Feb 25, 2012 (gmt 0)

New User

5+ Year Member

joined:Feb 25, 2012
posts: 1
votes: 0

I've got this figured out about half way. I'm trying to accomplish both adding a 1+ button to my site and adding organizational microdata for company name, address, phone number, etc

I have all the item types & item properties set correctly in the html body for organizational data. I also have the appropriate item properties in the head tag for the 1+ button snippets.

The confusing part is how to set the html tag above the head tag in my page. The Google 1+ setup page says:

<!-- Update your html tag to include the itemscope and itemtype attributes -->
<html itemscope itemtype="http://schema.org/LodgingBusiness">

But in the Google forum a Contributor was saying you don't actually add the itemscope or itemtype in the html tag, but rather in the div element in the page (which I do have setup correctly). She states to add the schema.org namespace:


...in the html tag. Right now my html tag is displayed as:

<html xmlns="http://www.w3.org/1999/xhtml">

Do I extend the html tag to read as:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:schema="http://schema.org/">


Also, if my schema type if for a "LodgingBusiness", I have this itemscope itemtype set to such in the body div element. Do I also need to make it set as this in the html tag?
2:27 am on Feb 29, 2012 (gmt 0)

Administrator from JP 

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 12, 2000
posts: 15075
votes: 142

Welcome to WebmasterWorld lsargent.

I moved your thread over to our HTML forum where hopefully it will get some more attention.
3:02 am on Feb 29, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Sept 4, 2001
votes: 49

Hi lsargent and welcome to WebmasterWorld.

Whether you use (for example)
<div itemscope itemtype="http://data-vocabulary.org/Product"> or
<div itemscope itemtype="http://schema.org/Product">

you do not need to place xmlns:schema="http://schema.org/" in the <html> tag. It is placed in the <div> tag as I have shown above. I cannot say I have ever seen the schema in the <html> tag. Also, I have put organizational microdata, a.k.a. Rich Snippets on several sites for both as results in SERPs and in use with Google+, and never added that.

After you get the snippet together, test it with Google's Rich Snippet Testing Tool [google.com] But do note that just because you have them, does not mean Google, or any other SE, will include them in SERPs. Google will, however, recognize it for when a person uses the Google+ button.

Also, remember that Facebook will not recognize the snippet as they use Open Graph Protocol (OGP [ogp.me]). Something you may want to consider if you have a Share/Like on facebook link. For that, you do have to add a schema to the <html> tag -
xmlns: og="http://opengraphprotocol.org/schema/
Note: in the above schema, there is no space between the : and o. I had to put it there as the forum kept making a :o