meta-tags - Google 网站搜索中的元标记

标签 meta-tags google-search

我计划实现 Google 站点搜索(并付费以便我可以访问 XML)。我想知道的一件事是是否可以在其中使用自定义元标记。

我从同事那里听说是的,但没有得到证实。寻找答案却一无所获(也许是因为你不能?)

有人知道吗?

编辑:我希望能够从搜索结果中检索这些元标记,以便能够为不同类型的页面提供不同的样式。

最佳答案

是的,您可以做到这一点,但据我所知,不能使用元标记。相反,Google 允许您将自定义属性放入 HTML 中,然后可以从 Google 自定义搜索结果 API 返回的 XML 中检索这些属性。

看看 http://code.google.com/apis/customsearch/docs/snippets.html有关其工作原理的更多信息。 Structured Data部分概述了您可以将自定义元数据粘贴到页面中的具体方法,以便 Google 会将其与每个搜索结果一起返回给您。最简单的似乎是 PageMap,它是 HEAD 中的 HTML 注释,如下所示:

  <!-- 
  <PageMap> 
     <DataObject type="document"> 
        <Attribute name="title">The Biomechanics of a Badminton Smash</Attribute> 
        <Attribute name="author">Avelino T. Lim</Attribute> 
        <Attribute name="description">The smash is the most explosive and aggressive stroke in Badminton.  
                                      Elite athletes can generate shuttlecock velocities of up to 370 km/h.  
                                      To perform the stroke, one must understand the biomechanics involved,  
                                      from the body positioning to the wrist flexion. </Attribute>                                       
        <Attribute name="page_count">25</Attribute> 
        <Attribute name="rating">4.5</Attribute> 
        <Attribute name="last_update">05/05/2009</Attribute> 
        <Attribute name="thumbnail">http://www.example.com/papers/sic.png" width="627" height="167" /> 
     </DataObject> 
  </PageMap> 
  -->  

如果您绝对必须使用 META 标记,则 Bing Search API确实支持索引 NAME 属性以“Search.”开头的所有元标记,例如

<meta name="Search.MyCustomProp" content="Hola mi amigo Google, I want my META!">

然后在 Bing Results API 中,您可以使用 WebResult.SearchTag property 提取所有这些值。 。发出请求时,您需要 WebRequest.SearchTags Property或者您可以只在搜索查询中添加文本,例如poodle meta:search.MyCustomProp(amigo) 在 search.MyCustomProp 元标记包含单词“amigo”的页面上搜索单词“poodle”。只要每秒查询次数低于 7 次并遵守详细的其他一些限制,即可免费使用 Bing API here .

很抱歉谈论了这么多有关 Bing 的内容,请随意忽略这一部分 - 但我在之前的工作中使用 Bing API 获得了相当积极的经验。

关于meta-tags - Google 网站搜索中的元标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2381305/

相关文章:

facebook - 为什么当我在 Facebook 上分享链接时,我只能从 12 个缩略图中选择 3 个?

java - 该内容无法在框架中显示

redirect - 如何在整个站点范围内正确更改页面扩展名,以免在 google 中失去排名

grails - Grails 应用程序中的 Google 搜索

python-3.x - 使用 python + selenium 模拟谷歌搜索的控制台应用程序

python - 使用 Selenium FirefoxDriver 在 Google 搜索上禁用样式

internet-explorer - GCF 中的 IE=Edge 是做什么用的?

facebook - 强制 Facebook OG 图像一致性

internet-explorer - 对&lt;meta http-equiv="X-UA-Compatible"content="IE=edge">的误解

没有网页的 Android 应用索引