是否可以为opengraph和schema.org使用相同的元标记 [英] Is it possible to use the same meta tag for opengraph and schema.org
问题描述
我不喜欢文档头部的标签数量。
这里是一些meta标签的例子。
<! - w3c - >
< title>页面标题< / title>
< meta name =descriptioncontent =great description>
<! - schema.org - >
< meta itemprop =namecontent =页面标题>
< meta itemprop =descriptioncontent =great description>
<! - opengraph - >
< meta property =og:titlecontent =Page Title>
< meta property =og:descriptioncontent =great description>
是否可以合并标签/属性以减小代码大小而不影响SEO?
例如
< title itemprop =name>页面标题< / title>
itemprop属性可以在任何地方使用,所以我敢肯定这是很好的
,但据我所知,属性=og:*属性必须与元标记一起使用。
那么下面的标记是可以接受的吗?
< meta name = descriptionitemprop =descriptionproperty =og:descriptioncontent =great description>
以及这会如何影响SEO?
非常感谢
HTML + RDFa 1.1和Microdata 扩展 HTML5的 meta
元素。
HTML + RDFa 1.1(W3C Recommendation)定义:
lockquote
如果RDFa @property $ c $
,元
元素上不存在 @ http-必须指定equiv
, @content
属性。
如果
元
元素具有itemprop
属性,名称
,http-equiv必须省略
和charset
属性,并且必须存在content
属性
表示: 不允许将Microdata的
itemprop
属性与HTML5的名称
属性一起使用。允许使用RDFa的属性
属性和HTML5的名称$ c
< meta name =descriptionproperty =og:description content =great description/>
(可能是一个问题,在 body
而不是头
似乎允许将Microdata的 itemprop
属性与RDFa的<$ c $如果没有提供HTML5的 name
属性,那么c> property 属性
< meta itemprop =descriptionproperty =og:descriptioncontent =great description/>
(但 W3C Nu Html Checker 报告错误)
I dont like the amount of tags in the head of my document. here is an example of some meta tags.
<!--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">
Is it possible to combine the tags/properties to reduce the code size without affecting SEO?
for example
<title itemprop="name">Page Title</title>
itemprop attributes can be used anywhere so I'm pretty sure this is fine
but as far as i am aware the property="og:*" attribute must be used with a meta tag.
So is the following markup acceptable?
<meta name="description" itemprop="description" property="og:description" content="great description">
and how will this affect SEO?
many thanks
HTML+RDFa 1.1 and Microdata extend HTML5’s meta
element.
HTML+RDFa 1.1 (W3C Recommendation) defines:
If the RDFa
@property
attribute is present on themeta
element, neither the@name
,@http-equiv
, nor@charset
attributes are required and the@content
attribute MUST be specified.
Microdata (W3C Note) defines:
If a
meta
element has anitemprop
attribute, thename
,http-equiv
, andcharset
attributes must be omitted, and thecontent
attribute must be present.
That means:
It’s not allowed to use Microdata’s
itemprop
attribute together with HTML5’sname
attribute.It’s allowed to use RDFa’s
property
attribute together with HTML5’sname
attribute:<meta name="description" property="og:description" content="great description" />
(possibly an issue with having this in the
body
instead of thehead
)It seems to be allowed to use Microdata’s
itemprop
attribute together with RDFa’sproperty
attribute if HTML5’sname
attribute is not provided:<meta itemprop="description" property="og:description" content="great description" />
(but the W3C Nu Html Checker reports an error)
这篇关于是否可以为opengraph和schema.org使用相同的元标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!