Hide Microdata Property Value In 'content' Attribute?
Solution 1:
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
<spanitemprop="name"content="Generic Name Here"></span>
you should use
<metaitemprop="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
withcontent
for information that cannot otherwise be marked up.
Solution 2:
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.
Solution 3:
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
Post a Comment for "Hide Microdata Property Value In 'content' Attribute?"