Is it possible to use the same meta tag for opengraph and schema.org
Asked Answered
J

3

12

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

Juliajulian answered 5/12, 2013 at 13:18 Comment(1)
The SEO part of your question would be off-topic for SO, as there are many search engines, most of the time they do not document how exactly they interpret HTML documents, and even this unknown interpretation might change daily. I think it would be best if you edit your question and remove the SEO parts.Neper
N
17

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 the meta 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 an itemprop attribute, the name, http-equiv, and charset attributes must be omitted, and the content attribute must be present.

That means:

  • It’s not allowed to use Microdata’s itemprop attribute together with HTML5’s name attribute.

  • It’s allowed to use RDFa’s property attribute together with HTML5’s name attribute:

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

    (possibly an issue with having this in the body instead of the head)

  • It seems to be allowed to use Microdata’s itemprop attribute together with RDFa’s property attribute if HTML5’s name attribute is not provided:

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

    (but the W3C Nu Html Checker reports an error)

Neper answered 6/12, 2013 at 17:4 Comment(2)
This means the OP is also allowed to do <meta itemprop="description" property="og:description" content="great description">.Leaven
"not allowed to use itemprop together with name attribute" -> well that's funny because the very website we're on right now does just that ;)Assyriology
R
1

How much meta data you use is up to you. There are at least 5 standards, some like Google+ or Pinterest will fall back to OpenGraph. I don't think any search engine will penalize you for following industry standards. If your website sells product and you have product listing pages with many products per page you will likely want to use schema.org, all the major English language search engines and Yandex have agreed to support it. If your website is more content focussed, schema.org is a lot less important but supporting OpenGraph plus Twitter Cards and even Rich Pins may be more of a necessity.

This is a good article on the various competing standards and which to use. Many people want all the traffic they can get so support many standards.

Racy answered 20/12, 2013 at 20:52 Comment(0)
O
1
<!DOCTYPE html>
<html vocab="http://www.w3.org/2011/rdfa-context/rdfa-1.1" lang="en" dir="ltr">
<head>

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

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

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

<meta property="schema:description og:description" content="great description">

</head>
<body>
</body>
</html>
Oppressive answered 10/4, 2014 at 9:26 Comment(1)
At this example the last line is redundant because I have it defined already in two different lines before.Oppressive

© 2022 - 2024 — McMap. All rights reserved.