问题原文
原帖链接 · GrapeSoda · CC BY-SA 3.0
My client has recently implemented the sameAs markup for the social media profiles.
They have used Microdata as they don't want to use JSON-LD as they feel it'll be some work to go through the site and change it all around.
I have noticed that they have added a div with an itemtype of Organization and a link tag with itemprop not wrapping anything.
Example:
<div itemtype="http://schema.org/Organization">
<link itemprop="url" href="domain name">
<a itemprop="sameAs" href="instagram"></a>
<a itemprop="sameAs" href="facebook/"></a>
<a itemprop="sameAs" href="twitter"></a>
<a itemprop="sameAs" href="google+"></a>
</div>
This has resulted in only 2 of the social media profiles appearing in the knowledge graph.
They have icons further down the page with links to the social media profiles. Should they not instead wrap these anchors around those instead?
已采纳解答
原帖链接 · unor · CC BY-SA 3.0
If they have visible links to these social media profiles, it’s the best practice to mark up these links, instead of repeating the links and marking up the "invisible" variant:
<div itemscope itemtype="http://schema.org/Organization">
<!-- … -->
<ul>
<li><a itemprop="sameAs" href="http://social-network-1.example.net/foo">Social Network 1</a></li>
<li><a itemprop="sameAs" href="http://social-network-2.example.net/foo">Social Network 2</a></li>
</ul>
</div>
If they don’t have visible links, or if it’s not possible to add Microdata markup to existing links (e.g., because the CMS doesn’t allow it), repeating them is better than not providing Microdata for them at all.
If repeating them and needing them to be invisible, the link element should be used instead of empty a elements:
<div itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" href="Foo" />
<link itemprop="url" href="http://example.com/" />
<link itemprop="sameAs" href="http://social-network-1.example.net/foo" />
<link itemprop="sameAs" href="http://social-network-2.example.net/foo" />
</div>
Even if the page doesn’t contain any visible social media links, adding them in Microdata is still better than not adding them; but in such a case Google might decide not to use them for their Social Profile Links.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
