如何隐藏微数据架构?

Ove*_*net 19 html microdata

我有以下问题.我已将微数据架构添加到我的页面,但我想要隐藏.有人有想法吗?

我使用的代码如下:

    <div itemscope itemtype="http://schema.org/LocalBusiness">
<a itemprop="url" href="http://www.example.net/"><div itemprop="name"><strong>Audiosky Mobile Development</strong></div>
</a>
<div itemprop="description">Description/div>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="addressLocality">Los Angeles</span><br>
<span itemprop="addressRegion">California</span><br>
<span itemprop="postalCode"></span><br>
<span itemprop="addressCountry">USA</span><br>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)

小智 26

如果要隐藏标记,可以使用元标记.例如来自schema.org 入门页面的示例

<div itemscope itemtype="http://schema.org/Offer">
  <span itemprop="name">Blend-O-Matic</span>
  <span itemprop="price">$19.95</span>
  <div itemprop="reviews" itemscope itemtype="http://schema.org/AggregateRating">
    <img src="four-stars.jpg">
    **<meta itemprop="ratingValue" content="4">**
    **<meta itemprop="bestRating" content="5">**
    Based on <span itemprop="ratingCount">25</span> user ratings
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

对于不可见的链接,请使用示例中的标记链接.

<div itemscope itemtype="http://schema.org/Offer">
  <span itemprop="name">Blend-O-Matic</span>
  <span itemprop="price">$19.95</span>
  **<link itemprop="availability" href="http://schema.org/InStock">**Available today!
</div> 
Run Code Online (Sandbox Code Playgroud)

但是,不要过度使用隐藏文本,因为搜索引擎可能会认为它有点垃圾.在您的情况下,我建议将标记放在主页或联系页面的地址块中,并隐藏少量标签.


Cha*_*had 12

比css hide或meta&link标签更好,使用JSON + LD

例如来自https://schema.org/LocalBusiness

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "LocalBusiness",
  "address": {
    "@type": "PostalAddress",
    "addressLocality": "Mexico Beach",
    "addressRegion": "FL",
    "streetAddress": "3102 Highway 98"
  },
  "description": "A superb collection of fine gifts and clothing to accent your stay in Mexico Beach.",
  "name": "Beachwalk Beachwear & Giftware",
  "telephone": "850-648-4200"
}
</script>
Run Code Online (Sandbox Code Playgroud)

  • 您好@MustafaMagdi:我是Google的开发人员,致力于AMP.我们已经完成了JSON + LD实现,现在更喜欢JSON + LD.您发布的链接已更新.随意删除您的评论,我也会删除这个评论. (4认同)
  • 请查看以下链接:https://developers.google.com/structured-data/rich-snippets/reviews"我们正在为此Rich Snippet类型实施JSON-LD支持.目前,我们建议使用微数据或RDFa" (2认同)