html - 是否可以对 opengraph 和 schema.org 使用相同的元标记

标签 html seo facebook-opengraph meta schema.org

我不喜欢文档头部的标签数量。 这是一些元标记的示例。

<!--w3c-->    
<title>Page Title</title>
<meta name="description" content="great description">

<!--schema.org-->
<meta itemprop="name" content="Page Title">
<meta itemprop="description" content="great description">

<!-- opengraph-->
<meta property="og:title" content="Page Title">
<meta property="og:description" content="great description">

是否可以结合标签/属性来减少代码大小而不影响 SEO? 例如
<title itemprop="name">Page Title</title>
itemprop 属性可以在任何地方使用,所以我很确定这很好 但据我所知,property="og:*"属性必须与元标记一起使用。
那么下面的标记是否可以接受?

<meta name="description" itemprop="description" property="og:description" content="great description">


这将如何影响 SEO?

非常感谢

最佳答案

HTML+RDFa 1.1 和微数据 extend HTML5 的 meta 元素。

HTML+RDFa 1.1 (W3C Recommendation)定义:

If the RDFa @property attribute is present on the meta element, neither the @name, @http-equiv, nor @charset attributes are required and the @content attribute MUST be specified.

Microdata (W3C Note)定义:

If a meta element has an itemprop attribute, the name, http-equiv, and charset attributes must be omitted, and the content attribute must be present.

这意味着:

  • 不允许将 Microdata 的 itemprop 属性与 HTML5 的 name 属性一起使用。

  • 允许将 RDFa 的 property 属性与 HTML5 的 name 属性一起使用:

    <meta name="description" property="og:description" content="great description" />
    

    (possibly an issuebody 而不是 head 中)

  • 如果未提供 HTML5 的 name 属性,似乎允许将 Microdata 的 itemprop 属性与 RDFa 的 property 属性一起使用:

    <meta itemprop="description" property="og:description" content="great description" />
    

    (但是W3C Nu Html Checker报错)

关于html - 是否可以对 opengraph 和 schema.org 使用相同的元标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20401085/

相关文章:

javascript - 使用 "for"属性转换 IE 特定的 JavaScript

javascript - 如何延迟加载图像并使它们可用于打印

php - Opencart 标签 url seo 友好吗?

IOS Facebook SDK - 发布开放图谱并在时间轴上显示而无需单击事件日志

Facebook feed 对话框重定向 uri_problem

html - 背景 : fixed no repeat not working on mobile

html - 将标题文本与同一行的后续文本对齐

seo - 我的网站页面未在 google 中编入索引

web - .com 域名在美国人的 SEO 结果中是否会比 .be 域名更有优势

Facebook、opengraph,它们是如何裁剪的?