Hide Microdata property value in 'content' attribute?
Asked Answered
W

3

0

I work on a website that recently had Schema.org markup added to it, but I think it is being used wrong.

Schema.org gives the example of

<span itemprop="name">Generic Name Here</span>

Our website implemented it in the following way

<span itemprop="name" content="Generic Name Here"></span>

Is the second way, our way, considered cloaking? We display the data to the user but at a different point and it is not marked up with itemprop.

Warplane answered 18/9, 2013 at 13:6 Comment(1)
I am rather inclined to think that it's the 2nd point you mentioned. Perhaps works as some kind of cloaking mechanism .Carraway
B
3

In HTML5, the content attribute is only allowed on the meta element. Microdata doesn’t define it as global attribute either. But RDFa extends HTML to make content a global attribute.

According to your example, you are using Microdata. So you shouldn’t use the content attribute for span.

Microdata defines a way to add name-value pairs without having to mark up visible content: Microdata extends HTML5 to allow meta and link in body (in the future, this will be defined in the HTML5 spec directly; see the "Contexts in which this element can be used" for link and meta in the HTML 5.1 Editor’s Draft).

So instead of

<span itemprop="name" content="Generic Name Here"></span>

you should use

<meta itemprop="name" content="Generic Name Here" />

For schema.org, see Missing/implicit information: use the meta tag with content:

This technique should be used sparingly. Only use meta with content for information that cannot otherwise be marked up.

Beaune answered 19/9, 2013 at 15:6 Comment(0)
O
1

If you want to stick with microdata schema then you need to switch to the meta tag, exactly as 'unor' has written and explained very well. However, you could go with JSON-LD and put everything in the header and eliminate the badly written microdata if you want to save time. JSON uses the same schema method as microdata, but the coding is different.

Oporto answered 18/8, 2018 at 2:59 Comment(0)
I
0

I mean technically it correlates with the ideology of cloaking in the sense that the spiders are seeing something that the users aren't. Which is why i'm inclined to advise you to avoid such markup but also i'm not sure upon googles stance; as such markup isn't indicative of cloaking for SEO.

"Cloaking is a search engine optimization (SEO) technique in which the content presented to the search engine spider is different from that presented to the user's browser." .

Source - Wikipedia

Incidence answered 18/9, 2013 at 13:58 Comment(2)
Yea...I'm working on fixing the schema.org setup but I can't decide on how beneficial it will be to our rankings. My thought is that having <span></span> with no visible content is probably considered cloaking because we aren't doing meta tags - so the user should see something, yet we display no content which is equivalent to something different.Warplane
I'm not sure either; Google hasn't specifically said anything about your situation, so its somewhat of a grey area. But i'd recommend checking out google.com/webmasters/tools/richsnippets to see whether the markups being found correctly. To be honest, this site probably isn't the best place to go for advice. Instead i'd recommend going to either the Q&A at Moz and asking this there or forums such as HighRankings and SEOChat.Incidence

© 2022 - 2024 — McMap. All rights reserved.